And why isn't this "hostile work environment" a problem for all the places that do have open salaries, like every government and union shop in the world
It is. The professors at the public college I went to were ALWAYS bitching about this. I also worked in the IT department of a manufacturing company and watched the shop workers cheer and applaud as they signed the dismantlement of their union, partly because of this.
The reality is that almost everyone thinks they deserve more than the next person. No one will ever admit they're second rate even if they are. With hidden salaries, there's just 2 people "fighting" with each other. The company to pay as little as possible, the employee trying to get everything they can.
When everyone knows, then everyone starts looking at each other. "Well, I'm better than THIS person. The 10 people I play pingpong with during lunch TOTALLY agree". It's already bad enough that this happens with titles. To properly gauge why I make a certain amount of money, everyone comparing themselves to me need to know not only my salary, but everything I've done, all my contributions, all of the deals I might have made (eg: special vacations or waving certain benefits I can legally wave). There's also plenty of other things that can affect compensation that are simply no one's business (maybe someone has some health issues that reduce productivity and they made a deal to work smaller days and don't want the world to know).
It's fine that HR and maybe my manager knows this. The rest of the company simply doesn't need to. Right right now that asymmetry is often used to discriminate against minorities, so people want to get rid of it. It won't always be that way (heck, right now in a lot of companies the other way around is happening). You don't want that shit public.
Sure, some type of organizations do, and some have to, and they make it work. Doesn't mean it's optimal.