There have been plenty of lawsuits, with widely varying results, concerning the ability of schools to punish or sanction students for activity off-campus. The law here is very much in flux, and the different rulings often depend very much on the specific details of the acts in question. In this latest case, a student who was running for Senior Class Secretary was officially barred from running, from speaking at an assembly for the candidates, and then from accepting the position after she was elected anyway... because she had complained publicly about what happened with a "battle-of-the-bands" event
called Jamfest. The details on what happened with Jamfest are a bit disputed, but either way, the student, Avery Doninger, wrote up a blog post that referred to school officials as "douchebags," concerning their actions related to Jamfest, which resulted in the school's actions over the student council election.
The court doesn't appear to have a problem with the school's action, and lawyer John E. Ottaviani, who wrote up the post linked above seems to agree. I'm not so certain. The school seems to have blocked both some of her speech, punished her for her speech and then blocked others from speaking out as well (banning other students from wearing t-shirts in support of Doninger). Yes, schools have the right to discipline students for violating policy, but it seems that a line is crossed when it involves barring expression, which seems clear happened here.