Why should someone more qualified make less just because they are a bad negotiator or just unaware of what everyone makes?
Employers typically want this information because as a whole it is in their favor, not the employees' favor to keep this information from being disclosed.
I have experience working in both the private and public sector.
Private sector salaries (USA) are typically not publicly disclosed and companies often have policies forbidding disclosure despite laws that say this is not enforceable.
Public sector typically is disclosed so anyone can just look it up.
My experience has been it is more difficult to negotiate salaries when salaries are not disclosed. In the negotiation it is very beneficial to show relative value and say, "I am more productive than 80% of the team, but getting paid at the median, so I deserve a raise." When salaries are unknown the company can more easily make claims that they just can't give you a raise because it wouldn't be fair to everyone else etc... You can always move to a different company, but if you aren't wanting to make a move that is not helpful.