Also, perhaps women getting pregnant was and is a real issue. There might be real risks and costs attached to companies.
And you make the same mistake as the parent I replied to, looking at thing out of context: presumably there are jobs where women were less likely to be promoted, but at the same time you neglect that there are jobs where men are less likely to be promoted (or being hired to begin with). Overall, men don't get a free pass in society, otherwise there wouldn't be so many books and articles on career advice. It's not like "hey, you are white and male? - hired!".
The context mistake is particularly easy to see in IT: because there are many more men than women in IT, for every woman who doesn't get promoted there are several men who don't get promoted. But only if a woman doesn't get promoted it makes headlines and she can sue for sexism.