I take that statement back. It is the Principal’s discretion. The LOCAL school can set a policy.
I do not think any court should review it, all proper authority is to the Principal and School Board. The recourse from a harm is via personal or popular rebuke to those two.
The problem is that the principal made a subjective judgment ( possibly insulting) not one based on the policy. If he had simply said the shirt was not allowed because it violated the policy then you would be right. Since he made a value judgment outside of policy then he's in the wrong.
[The LOCAL school can set a policy.]
So, when it comes to clothing, it is a LOCAL issue.
But, when it comes to the required education and classes, should that too be a LOCAL issue? Do you support No Child Left Behind? Do you think state-level mandated testing is a good thing?