Companies are free to pay what the market will bear. Workers are free to choose whom to sell their labors and skills.
Heck, if you can get away with paying women less than men, then why are companies not chocked full of women? It’s logical, after all, since personnel costs are huge and hiring only women that can do the same job means more profit. . .