Yup--this could have been an excellent teaching moment and the teacher blew it. I had good teachers in high school and they wouldn't have taken this position. I would have used the moment for a discussion; why be afraid from of the hat--and also, don't rules exist to be broken, and by breaking them intentionally, what outcome are you hoping to achieve? I of course don't believe in teaching conformity. Kudos to the kid, he is mainly in the right.