I would have taught it's the opposite. If women are discriminated against because of having children, I guess the companies that doesn't discriminate against women (or even actively helps them) would get all the good ones?
But in this case, the discrimination is rational. Due to maternity leave, a woman of equal skill creates significant cash flow risks - if she takes leave, you either go for 3 years with her job not getting done, or else you hire a replacement and risk being stuck with unnecessary employees in 3 years.
That is not how it works in Sweden (nor anywhere else that I know of). The replacement is hired as a temporary position until the original employee returns.