The university can try to punish you for things you say or do on Twitter, but are they within their rights to do so? Quite possibly, not. It depends, of course, what's posted or said on Twitter in terms of the school, is within its rights to do so. A student does have an obligation to live by the school's code of conduct, other policies that may be at play. A student does of course have rights under the constitution, freedom of speech, for example, it's a limited right to a certain extent but the student does have rights, depends what's posted.
Is it sexual nature, racial nature, threatening in nature? That's a certain consideration. It is just a matter of somebody having a different opinion and the student being brought up on charges. It's not at all. Typical, school is overzealous in pursuing charges in such an instance, that's why it's very important to protect your rights and interests. An experienced attorney-advisor can help you best understand the process and navigate it moving forward if you're facing an allegation of that nature.