That's because it is in the equality act.
It would need a complete rewriting.
It's not about denying Debbie H his job, it's about telling him not to wear a dress at work, because he's just told everyone it turns him on.
The man in Canada with a gigantic breasts is a case in point. That is where this leads.
It's a minefield, though, because clothes are clothes.
Personally, I think it's quite hard to legislate what clothes people wear, without reinforcing gender boundaries.
But you could definitely start with pronouns, calling a man a man, and making him use male facilities.
Historically we managed it socially, with the understanding that everyone knew what was appropriate, and applied social behaviour as a result.