They have a dress code, they have to consistently enforce it across everyone.
They can have one and more power to them, but it has to be applied across everyone.
You're right. If it's 'no sneakers' it's got to be 'no sneakers' for anyone. Period. Real racial discrimination is offensive.
Traditionally there are different dress codes for the genders. For example ties required for men but not for women...but what to do about those who want to declare themselves a gender they dont appear to be?