Inaccurate to call it clever, because the artifice is visible. The judge has bastardized the law as written.
The cause for firing, in the end, is failure to adhere to the established dress code for a particular gender.
The judge could easily have ruled that the employee was following an established dress code, and ruled in the employee’s favor.
Consequently, the ruling is wrong and must be overturned.
And this thought comes from a belief that people should be able to make their own rules.