If all salary was displayed publicly it wouldn't help the employee. It would take almost all negotiating abilities away (a senior developer with 5 years of experience will be paid the same rate as a senior developer with 10 years because companies don't want unhappy employees and people with the same titles will be upset they are not paid the same rate) and allow many companies to legally collude and pay similar rates (which will be the lowest they can get away with).
For the individual, not having public salary works great because you really do have negotiating power. I no longer work for anyone, but when I did, I would regularly ask for a higher wage at my next company for essentially the same position.
If my next company knows that all other companies in the industry are paying 20% less for my position, why would they pay me more?
I've also heard stories from Sweden where larger companies will pull tax returns of the other companies (and employees) they are doing business with and will base their contracts on this information being a regular practice(giving lower rates because they know the company is making more money. Or even not dealing with the company at all because they are so small).
I've never understood why smart people want to willingly give the more powerful in this world even more tools that will work against them.