Bingo!
I think that is exactly what happened in this case. The student clearly violated a rule the institution thought important. The school has the authority to enforce that particular rule, its action was not arbitrary or a deprivation of the student's right to free speech.
Most of us realize service schools and the military at large are all about rules, most especially when it comes to training its officers. As argued elsewhere on this forum, such a student should not be surprised if his appointment to a military academy is given a second consideration.
I pray you never show up on a jury.