There has to be some degree of punishment for kids in school, as you need a way to make them understand that the real-world doesn't tolerate certain types of behaviour. You obviously want to understand your kids and see why they behave in the ways that they do, but that only works to a certain point. The issue about embarrassing them is not mercilessly mocking them in front of their peers, which would be absolutely unacceptable; it's done in a way that is relatively light-hearted and makes them understand that actually you're on their side and want what's good for them, but also shows them that you're better than them at their own game than they are. So long as you aren't targetting one or two kids you can generally have a very positive effect on the class with it.
If you counter that with a strict attitude that you can draw out when necessary, they realise that the choice is between an easy-going, relatively fun teacher or a strict, boring and annoying teacher, and that it's their power to choose. That's the key thing here: you keep discipline in your class by punishing them when necessary, but you simply provide them with an incentive to not act up in the first place. That is absolutely doable with 99% of kids.
Now of course some right-wing people here will bring up cases of teachers being stabbed or abused in the classroom. Frankly, some of those kids need mental help, and a "good caning" or whatever wouldn't change a jot. If you're a kid and you think seriously injuring your teacher is a good idea then your problems are a lot bigger than what a school can normally deal with.