I don't see school rules as being that different from rules in other places in society. Most workplaces have a dress code, a tardy policy, a sexual harassment policy, and an unwritten code of conduct for things like how to speak to the boss. These aren't laws (with the exception of the sexual harassment one), but workers are expected to abide by them. I don't see why we shouldn't expect the same of our students.
Even businesses have rules. "No shirt, no shoes, no service" comes to mind. Society has to have these rules to keep things polite and to avoid trampling other people's rights.
I'm sorry, this analogy is pretty off-base except in the most general of ways.
There are different justifications for rules. Workplaces that have dress codes, tardy policies, etc. can expect obedience to these rules because otherwise they can fire the employee. In fact, they cannot enforce these things through the court system or the police.
Similarly, the "no shirt, no service" rules aren't enforced through legislation (usually, actually in some places there may be health code laws), but by the refusal of service and the fact that customers are considered licensees (i.e., they're legally allowed on the business property, but with limited rights to stay. Violate those conditions, and they become trespassers).
Students aren't under either of these justifications, and teachers and administrators should remain well aware of this (though in practice I don't think they do). What does allow many of the rules is the mandate of the educational institution to teach: if a certain behavior or speech causes academic disruption, the school may restrict it. It's highly questionable whether schools should have any say over things like hair color/style, makeup, messages on shirts, or proselytization. That it might possibly create some disruption isn't a good enough justification, there needs to be a showing that it would indeed actually cause disruption.
Schools are given pretty wide latitude over discipline, and I think sometimes this gives admins and teachers the idea they can simply do anything. It's not just free speech they're limiting -- schools step over all sorts of rights we have in general society (often legally doing so, but sometimes not). For example, students accused of wrongdoing do not get the right of counsel, freedom from search, a jury, the right to confront their accusers, freedom from double-jeopardy or double-punishment, right of appeal, or freedom of association. I'm not suggesting those things should be implemented, as there are fairly good reasons to limit those rights and the overhead of trying to maintain a full justice system just to prevent kids from getting detention unfairly would be prohibitively expensive. What I am saying, though, is this: teachers work in an environment that is completely unlike US society in many important respects, and a teacher who doesn't pay attention to US society runs the danger of violating the letter or spirit of US law when operating within the confines of the school.
This is also the reason I absolutely despise the fairly commonly used, "Classroom Bill of Rights" lesson. The class bill of rights is so unlike the actual bill of rights, not just in subject matter but also purpose, that it does more harm than good in fostering any understanding.
As for teachers themselves, they have some limits as agents of government. Specifically, they cannot advocate a particular religion or lack of religion (there is actually a little leeway here even within legal bounds, and of course teachers step well over this line without punishment all the time). Though I don't think other opinions are technically illegal (I think, for example, a teacher could tell the students who they're voting for), sharing some of those other opinions probably isn't a great idea and may even be more likely to result in backlash than opinions on religion.
Of course, private schools are exempt from a lot of this.
And to Dave's point, a lot of schools create additional restrictions through contract.