The one time my father ever spanked me was after I attacked my little brother with a wiffle ball bat. I don't hold even the slightest grudge against him for that. On the other hand, my grandfather used to beat my father severely for things his younger brothers did wrong, under the understanding that his sons would punish each other if he punished one of them. That was clearly over the line, and my father resolved to never raise his own kids like that. And he didn't.
Should teachers be doing this though? I'm not sure. Teachers often don't have enough information to know when it is or isn't appropriate to spank a child. They don't really know what's going on in that kid's home-life. But maybe it is sometimes appropriate when they witness particularly egregious bullying at school.