There was a lot in my comment you just slid right over to only address the point you agreed with, I was hoping you might address literally anything else I wrote, but oh well. We agree that it can be a form of sexism, but it is more complex than that, hence why it is an intersectional issue. Why do you believe it necessarily stops having a racial connotation just because it can be used to hurt white people?
Just because white people have been subject to abuse due to their hair length, it doesn’t absolve the racial connotations and racist historical context when applied to non-white people with long hair. If this case was about an Indigenous American student, with religious reasons to wear long hair, would you be making the argument that this isn’t racial discrimination? What about a Sikh student? A Rastafarian?
This is an intersectional issue, and as such, requires a little more nuance in diagnosing than “Well I don’t see any white boys getting away with it, so it can’t be racist!” When rules are made, they need to be evaluated on their ability to hurt people. If the rule can disproportionately hurt people based on racial elements, that rule is racist. This kid is black, part of him expressing his blackness is his hair being long, so any rule forcing him to change his hair is racist. If it was an Indiginous kid, the rule would still be racist. If it were a white kid, the rule would still be racist. The rule and the people enforcing it are racist, even if they never apply it to anyone.
I don’t like these aesthetic rules for all the reasons I initially provided, which includes your provided reasons. They are invariably a combination of sexism, queerphobia, racism, religious persecution, and are generally authoritarian in a way that only exists to hurt people.
Let’s dissect the segragated school example, considering only black and white students. Pre-integration, forcing the white students to have short hair is a sexist and authoritarian rule from an explicitly sexist and racist institution. Upon desegragation:
If the school was genuinely concerned about equality for the black students, they could reevaluate the rules about hair and gauge whether or not it will have an outsized impact on the new black student population, which it would given the cultural context. Parallel to desegregation efforts was the reclamation of natural black hair among black people (afros being the most iconic example), many of whom had been forced or coerced into white-coded hair styles since slavery ended.
Counter to this, if the school wanted to hurt the new black population, they could maintain the rule and use the equal application of it as a shield against people crying foul. The rule is still sexist, as a part of an explicitly sexist institution, still authoritarian by the very nature of the rule, but the school’s racism has become implicit rather than explicit given who it now has the power to harm. This has been the racist playbook example since slavery was abolished, sliding the scale towards more implicit racial strategies in a culture that is less willing to engage with explicit race discrimination.
In the midcentury, long hair among white men became a symbol of the white counterculture, so curtailing it was authoritarian and sexist. At the same time, natural long hair among black men became a symbol of both black counterculture and black empowerment/liberation, so curtailing it was authoritarian, sexist, and racist. This dynamic exists to the modern day, and applies to different minority groups than just black and white people.