BYU is a private school. Like any private school, it can set its own rules and it criteria for attendance. If students don't want to abide by the rules, they are free to transfer to any school of their choice.
By the way, I have never seen this rule enforced with kind of rigidity you're suggesting might happen here.