I still don't see how it's legal for an accredited university to have rules prohibiting sexual activity of their students
Want to be a religious school? That's fine, but you won't be accredited to teach any Gen Ed classes. Have your catholic pastor school, or your rabbinical school, that's fine. But you won't be making those into general education colleges.
If they don't want to have rules that our society finds acceptable they don't have any right to just exist. This isn't a person were talking about they are an education institution. A school cannot by definition have a religion because it isn't a person. I don't particularly care if the people wo made the school are themselves religious; that should not give them the right to use their new founded institution to enforce those beliefs on other people. If you want to teach people I think you should be held to certain standards, and one of those standards is that you shouldn't restrict the freedom of your students.
Having sexual morality rules is absolutely restricting their freedom. People have a right to privacy that such rules inherently violate.