A university can try to punish a student for things they say and do on the school's social media network. Are they within their rights to do so? Not necessarily. It, of course, depends on what's posted or said on the social media network or on the school's network. Is it sexual? Is it racial? Is it threatening? That's a certain consideration. A student does have to abide by the school's expectations regarding its code of conduct and other policies that may be at play.
A student does also have certain rights, freedom of speech, although it may be a limited right. They do have certain rights to express themselves. Is it something that's posted or said that's simply unpopular and people take exception to and the school's overzealous in trying to seek charges against the student? It's not an unusual situation, regrettably. An experienced attorney-adviser would be your best ally in terms of understanding and protecting your rights and also helping to navigate the process moving forward.