I wonder if this discrimination is exacerbated in silicon valley where job tenures are so short and perks are so good. If on average, you keep employees for two years and offer 6-12 month parental leave, then an employee who uses it gets paid for two years while actively working for 12-18 months. That's 30-100% higher cost to you the employer per month of active output from the employee. The shorter the tenures and the longer the leave, the higher this extra cost.
As a society, it seems like a no brainer to want to allow new parents to spend lots of time with their kids, but it does incur a way higher cost to the employer, many of whom can't afford to pay employees 30-100% more. The most immediate answer seems to be to make society pay and not the employer. Something like a government funded regional cost-of-living adjusted stipend, or a capped wage matching?