But, yes, Universities also have legal duties to their students. However, these vary significantly based on too many different factors to speak usefully in generalities (eg based on city & state, public or private, is it a research university, is there some kind of consent decree, etc) and of course, the facts of each case.
More simply: whether a University has a legal duty to protect students from online harassment will depend on the specific situation, but, in all cases, the University will have an interest.