A male and female construction worker both wear dirty clothes and a hard hat.
A male and female stripper both wear no clothes.
A male and female clown both wear ridiculous clothes.
Whereas apparently male salesmen should be wearing short skirts and high heels? Or only women? That's the problem.
It could also be pink hats for men and and yellow umbrellas for women. Or white clothes for the elderly and brown clothes for the young. Or any other arbitrary rule.
Besides, suppose I have a shop and I discovered I sell more if I make men dress ridiculous, women dress erotic and elderly dress funny. So I require a dress code according to age/sex in order to optimize sales. What's the problem? Don't take the job if you don't want to
But the dress code wasn't "high heels and skirt," it was high heels and short skirts.
Men weren't being asked to unbutton their shirts to show off their pecs, or to wear tight pants to show off their bulge, but women were being asked to show off their legs and asses, at least implicitly.
First, it opens you up to massive sexual harassment and discrimination liability issues, and it's probably not even legal.
Second, the bad publicity will drive away good hires and lose you sales, so it's not even good business, unless maybe you're a pimp.
Third, it would make you a regressive, sexist jerk.
2- that's just your hypothesis. In my example I made the opposite hypothesis. That's irrelevant in any case.
3- The greatest jerk is the one who tries to impose their own preferences to prevent deals that have been freely accepted by all the parties involved.
A stripper, no clothes.
A clown, ridiculous clothes.
Different positions require different clothing. If you don't like your job, be it for clothing or what have you, you can quit.