I should add this only happens if you are the "right" kind of mother. 17 year old with a baby does not gain status from having a baby, quite the reverse. But for most mothers having children brings an increase in status. Suddenly you are a "proper" adult.
You still get discriminated against as a mother, get judged, and pigeonholed. But that does not take away from the increase in status.