There have been several cases that have confirmed that it is acceptable to have different dress codes for each sex. I can't quote case law, but I've had this discussion with my boss, the VP of HR. (Yes, I'm an evil HR drone) on a couple of occasions when it came to the allowing of earrings worn by female floor staff but not by male floor staff.