I wonder if the full transparency you're talking about is a part of how the city managed to attract and retain such talent pool. I know that for all of my career I've been worker harder than my peers and have also been compensated accordingly. If someone told me "oh no, [person who I know is less productive] has the same title as you and he never comes late to work, so you can't make more than him," that for sure would have been our last conversation at work.
I don't know why most companies don't want to disclose salaries, but every startup I've led did that in order to pay more, not less. You basically look for the most exceptional talent in the world, and then you pay them every last penny you can afford. Same with retention - you want to promote people based on what the market would pay for them, regardless if your current org structure allows for a title promotion (you can only have one senior leader per department at any given time). If I had to disclose everyone's salary, that would only lead to more constraints with being generous on my end, not less.