" a profit maximizing firm should not discriminate between workers of equal productivity based on immutable characteristics " Gender is an immutable characteristic? That's debatable. But whether it is or isn't doesn't seem to make discriminating by it better or worse. That makes immutability a poor discriminator of tolerable discrimination.
Actually I don't think anybody's debating that - transexuals say that they were born as whatever gender they identify with, they just say it doesn't match what their body looks like. Everybody seems to agree that it's immutable, even if there are people who can't seem to quite agree on how it's identified.