I understand. Of course there are reasons why people have tended to wear different things spanning the hundreds of years. But it’s also easy to generalize that people all presumably did a certain thing, and do another now. Unless we want the 21st century to remain a sexist culture, we cannot leave sex-specific dress codes unchallenged.
For example, here’s a post where I condensed a school’s sexist dress code to include the same clothes, without it being sex-specific, as they had it:
Likewise, places can specify that people need to wear flat dress shoes or high heels, but they don’t get to specify who wears which.