It would seem very unlikely that Congress could pass such a law. If they did, civil rights lawyers would probably have a field day with lawsuits against the government, for violation of people's rights.
A university, however, could get away with such a rule, because, university is private property, and can set their own rules. You might have students who would sue the university to challenge it, but... it would be like any other rule on a private property. Owner sets the rules, like TMF, etc. In my college, we had certain dorms that were 24 hour quiet dorms, and others you could make noise in all night. In the all night noise dorms, people screamed their heads off, and blasted music, at 3am. In the 24 hour quiet dorms, you got written up if they heard you playing music too loud at noontime.
Once anything is private property, no matter how "stupid" the rule might seem, even a lawyer or court might have a difficult time getting the owner of the private property to change the rules.
Mitch