My son loves hugging his teachers. I tell them my kid gets lots of hugs at home and finds them very comforting. All of his teachers in his elementary school have been the sweetest women you can imagine and have all hugged my kid and other kids in the school. But the school is very strict about punishing unwanted physical contact. Any kid who makes the mistake of hitting another kid will immediately find himself in the principal's office, and in a world of trouble. The key thing my kid's school has a zero tolerance for is bullying--verbal and physical. My kid tells me bullying in his school hardly ever happens because of that. And when it does it is immediately reported--usually by both teachers and other students--and punished.
It's sad that some schools don't want to take the risk of allowing "good touching," but I can understand why. It takes a lot more supervision and judgment to assure that it is in fact good. Some schools just don't have the resources for that, so they ban all touching.