Of course it's legal, but is it good behavior? Can the people who did this really be proud of themselves in anything more than a juvenile way?
I can see armbands, but standing and turning your back on someone receiving a degree? And to have an assistant dean participate in this?
Contrast this to the time Jimmy Carter spoke to us at the Air Force Academy in 1985. He was a former president, and not a very popular one in military circles. When he was introduced we jumped to attention, and at the end of his talk we cheered loudly. And when President Clinton, no rock star to most military personnel, attended an Army-Navy Game in the 90s, he was given at least polite applause by those in the stands as he crossed from one side of the field to the other at halftime. I know--I was there.
The students in the linked article have shamed themselves, and they're probably too stupid even to know it.