Of course it doesn't always help men. I've know two fathers that were discriminated after asking for a reduction in hours to take care of their children. In my country they have the right to do that. Yet, one of them was fired, and other was bluntly told that if he give up in his partial time working, they would make him project manager (deserved), but if he don't, he would never be promoted. That is discrimination.
On the other hand, mothers weren't given the option at all.
But it is basically about upholding gender roles. My experience is not unique. There are patterns and shared experiences.
Some men believe so strongly in gender roles that they really think they are doing you a favor by not promoting you or giving you raises. Their "logic" is that since you are going to have children at some point, you would prefer "safety". They are paternalistic. And to be fair, I've seen those same men protecting young women from sexual harassment. There is some consistency in their beliefs. And I'm sure their intention is not to hurt. But the result is still hurting us.
So usually the best solution is to say nothing but update CV with the task you have been performing, not the official title. That usually get you better wage and promotions.
I do still talk with that manager. From his perspective, he did nothing wrong and we are on friendly terms. I only agree on the second part. And that is the thing, managers and companies are more or less conscious that a bad rep has consequences, but aren't that good identifying the problem. I mean, if sexism or racism is too charged, take bullying. It is usually the bullied person the one who gets moved, not the bully. Yet, the bully would find a new target and keep messing with team productivity.