Here's the problem with any type of legislation that forces actors to do what they would otherwise not do...
It leads to unintended consequences that often hurt those whom the legislation was created to help.
Here's an example involving maternity leave. This will sound irrelevant, but I'll connect the loose ends.
I used to work for a very large money management firm. I was involved on many enterprise-wide projects that spanned several months. These were multimillion dollar projects. Women were rarely given the chance to spearhead them. Instead, they were almost always relegated to supporting roles.
Coincidentally, those few women who were given the chance to lead these projects openly professed to not wanting children. I saw this play out multiple times over a decade.
My suspicion is that the firm's senior management wanted to avoid placing projects on hold while a female lead was taking maternity leave. I know many of my cohorts at the firm felt this was the right decision given the cost of the projects and the consequences of delaying them.
In this case, an argument could be made that legislation forcing companies to provide maternity leave led to unintended consequences. The same will likely be true of legislation forcing them to provide space to pump. The only unknown variable is the nature of those consequences. This is the stumbling block of all central planners (whether they realize it or not).