Moral excuses aside, it's money. Huge gaps means less material, one-size-fits-all installation, and arbitrary tolerances in production. Same reason the latches constantly break or get stuck - the whole setup is mass-produced as cheaply as possible.
But it's not a good way to save money. On top of the obvious safety and privacy benefits, bathroom quality can completely change a person' opinion of an establishment and is worth investing in.
You think that the CIA pretends to be an international aid organization for the sake of advancing the interests of checks notes... China? The 3-letter agency that has spent decades building and maintaining American hegemony is now serving that same purpose for a rival nation? And the people that have also spent decades building for this moment to take over the federal government entirely... want to now give their power away? ... what?