Depends on how you define punishment. If it enters into the physical, it's crossed a line. There's the standard line that sometimes kids need to be taught a lesson - but there are non-violent ways of doing it, and as far as I'm concerned, anyone who takes the violent route is physically abusing a kid when they don't have to.
Not to mention that, in many, many cases, corporal punishment is LESS effective than other forms of punishment, and frequently doesn't work. Maybe for some kids, SOME kids, it works. But for many, myself included, it doesn't. I learn from having stuff explained to me, by giving me a reason not to do something, and every time my parents tried to punish me, I sat back, took it, and then misbehaved more to show them that crap cut no ice. Let me tell you, if my parents had ever done anything like that, I would probably be obsessed with getting payback - that kind of abuse of trust sickens me.
Seriously, how much imagination does it take to come up with a punishment OTHER than hitting a defenseless kid? Dress it up all you like, corporal punishment is just an excuse that parents use to justify taking their frustration out on their kids. There's more effective ways, there's ways that aren't just wrong.
Then there's the question of punishment in general - to that, it also depends. It's gotta be managed - there's traumatizing stuff, like the original example, there's ineffective stuff, etc. It is necessary at times though - sometimes, kids need to learn their limits, learn what is and isn't acceptable, and learn there are consequences for exceeding those limits. As to how, well, that's already been covered.