I have a question about this. I thought that whether or not a given practice is unconstitutional sex discrimination is constitutional is subject to an intermediate standard compared to a stricter standard for racial discrimination? If so, there would be room to say that separate male/female dress codes are constitutional, while something like separate dress codes by race obviously would not be?
Also, I could see someone from an originalist standpoint taking a absolutist position that the various clauses of the 14th Amendment were enacted to prohibit any sort of racial discrimination at any level of government, but weren't meant to apply to sex discrimination at all. However, that probably only has 2-3 votes even on this SCOTUS.
I admit I'm not sure of the boundaries between strict scrutiny and intermediate scrutiny. Separate bathrooms probably satisfy strict scrutiny. However, I'm not convinced that separate dress codes are supported by even intermediate scrutiny. The Constitution cannot be read in a way as to require only females to wear skirts.
As I understand it, sex discrimination does fall in the intermediate scrutiny bucket, though it tends to be on the stricter end of intermediate.
Here is a case out of the Fourth Circuit dealing with this in the context of charter schools receiving public funding; requiring a skirt for female students was found to be impermissible sex discrimination. This seems to be a case where the code falls closer to a uniform, instead of just being a standard that has to be satisfied but where the choice of what clothing to wear is left open, which presumably would not be an issue.
https://www.nytimes.com/2022/06/17/us/nc-school-dress-code-skirts-lawsuit.html