Why is grounding an option of punishment?

Is it necessary to be punished?

Disclaimer: I assume you mean "punishment", not like "corporal punishment" (which, as Torbengbb pointed out, is illegal in many countries).

I think it is very necessary as it is just an advanced form of the same basic learning steps that a child experiences in their early years.

In the first few years a child learns many things that amount to manipulating his environment:

  • When I touch the rattle it makes a sound.
  • When I move my arms and legs, I can move from one point in space to another.
  • When I slide the cup to my mouth, I can drink the water.

This experience can last a lifetime. Later it gets more complex:

  • If I put the right codes in my computer, it will do what I want.
  • When I put the cables together, the lightbulb lights up.
  • When I press the accelerator, the car goes faster.
  • When I hug my child, they stop crying.

Ideally there is the role of a parent / teacher in providing a protected environment in which all these experiences can be made without negative results harming the child / student.

  • Move the knife away if the child tries to touch it.
  • Bring the child back into the living room if they are trying to crawl to the stairs.
  • ...

From a child's point of view, these are frustrating experiences, they want something and they don't understand it. Often times it is difficult to take away a beloved toy, but parents do it anyway because they know it is better in the long run.

Later on, the distinction between good and bad becomes blurred, mainly because cause and effect are no longer so close together. But essentially the situation has not changed. Children still want to experience manipulation of their environment, but now in many cases there are no more immediate consequences. So it's up to parents to set artificial boundaries so their children can learn.

For example, if a child begins to lie, steal, and cheat because they learn that there is an immediate benefit, the consequences will most likely only become apparent when other people perform the "punishment", either through social isolation, unemployment, or even Jail.

In such situations, a good parent needs to step in and "anticipate" the consequences in a milder way. That way, a child can try to do all of these negative things without putting themselves in great danger.

You could say the literal playpen turns into a metaphorical playpen. The wooden borders are replaced by feedback from parents. From this perspective, having no discipline like letting a child play with a knife or dropping a toddler down the stairs is the same thing: it's irresponsible and can have disastrous effects and no good parent would allow it.