Tried the transparency bit. In larger companies like Amazon it might work because there's still a bit of anonymity. But for most companies large and small here's what happens:

Bob gets hired as a developer in 2012. He's been with the company for 4 years. Bob is a decent developer who gets his work done but makes the occasional mistake. Bob's title is application developer. When Bob got hired he took the job because the pay was as good if not better than his last job and the market was tough back then and he was happy to have the opportunity. Bob makes 50k a year and lives in Florida where the home office of the company is. Bob's title is software developer.

Fast forward to today:

The company is really taken off and they need to hire some top talent and have opened the doors to remote workers. John joined the team back in 2014 at 55k per year. John lives in Florida and is a mediocre developer. Sure he gets work done but it's often late or buggy. He tries hard and has shown much improvement and continues to every day. His title is software developer. There's a new IT manager and his job is to hire in some top talent to work with the current talent to get things moving. Prior to the hiring push the new IT manager sees the salaries currently and decides to bring salaries more in sync with what the market currently is at. As a result of this Bob, between his cost of living increases and this new pay bump is at 65k and John is at 60k.

As he can now look at remote workers he has feelers out around the country. An ace developer applies for a position and has some skills the company desperately needs. She is based in New York and demands a higher salary than the company traditionally pays because the cost of living is higher. The company approves her demands at 90k per year and she starts with the company, also with the title of software developer. Her name is Sally.

A month later the company decides to have transparency across the board with salaries and publishes everyone's salary.

John is immediately offended because in his mind (and by his title) he's doing the same job as Bob and Sally yet is making considerably less. Bob is upset because Sally just got hired and is making an extremely high amount more.

Each of them are considering their titles / positions. None of them are considering the individual situations that have led to the people making what they make.

So how should salary negotiations go. If the company is open and transparent, they should explain to John that basically he's not as good as the other developers so therefore he hasn't gotten the same cost of living increases etc. What he has been getting is an education and the opportunity to improve his craft.

Bob would need to know that he started low and it's just the nature of salaries to creep up the way they have. They'd have to discuss Sally's situation which frankly is none of Bob's business.

While all of them are valued employees, if they all made the same exact amount either it wouldn't be enough or the company would go broke quick. So they can either suck it up and deal with it or find a job elsewhere. They'll be disgruntled either way.

Remember your salary is your salary. Negotiate for what you think is fair. If you want a raise, ask for one. if you feel you should be brought up to current market rates, say so. Ultimately if you are not being treated fairly after giving the company ample opportunity to make it right and communicating with them, then find a new position. Finding out someone has something that is worth more than what you have will always make you want what they have, that's just human nature. Not disclosing salaries is more to keep harmony amongst the workers and people happy in their jobs and focused on THEIR OWN needs as opposed to just trying to get the same thing as someone else for whatever reason.

Are there companies who leverage this for nefarious purposes? Sure but you really shouldn't be working for those companies now should you?

The key here is communicate with your company. If you are valued they will try to accommodate you or at least give you a good reason, if you are met with resistance or reprecussions then maybe reexamine your relationship with them.