It has some mixed results. It's very positive for traffic and for climate change - if everyone goes from a 30 mile commute to a 5 mile one, that's 6x fewer vehicle miles traveled, 6x less car CO2 emissions, and 6x less traffic. But it also drives up rents around the office to crazy-high levels. Facebook's policy basically just boosted rents in Palo Alto by $1000/month (when they were there), and then it and the office location was single-handedly responsible for the gentrification of East Palo Alto (after they moved).
Let’s assume I moved to near that office and lived in a high density area away from nature and dark skies. What does my wife do, who now faces an 80 mile commute the other way?
For anyone but singles, co-located work seems anachronistic. Worked back in the day were only one person in the family had a job, and jobs were held for decades (not years) I suppose. Today it seems ludicrous to expect anyone to move for work.
Which naturally leads into either long commutes or remote work. Having built several remote-first companies, I'm gonna say it's not perfect, but it really works.
Going this way, if this were a law, would also prevent employers from treating people as expendable. Flying people in from across the globe because they are marginally cheaper than the local work force never made sense to me.