That's one of the stupidest rules I've ever heard.
Do you get detention for not shaving?
Also, I would totally grow a beard if I wouldn't have to wear a beardnet at work. Since I would have to wear one, no beard for me. That's a good enough incentive to remain at least moderately clean shaven.