The only people who benefit from salaries being kept secret is employers.
When you see the outrage over job listings without 'hard numbers' on this site you have to ask yourself why we still feel that our own salaries should be kept secret.
You have little to negotiate with if you don't know what your peers are earning. It only benefits employers.
My company requires that compensation be kept secret contractually (not sure how enforceable that is, but it's there with spouse, financial advisor, accountant and lawyer listed as exceptions). I have no idea what any of my colleagues make, and can only guess by seeing the type of houses they buy (which strictly still doesn't tell me if they're frugal and highly paid or reckless with a huge bond). There are various reasons for this:
1) Most employees will not be OK with being paid below the median of their group of colleagues - this is irrational behavior.
2) Most employees are not able to self-assess their value to the company very well.
2.1) Partially due to personal (ego) related bias.
2.2) Partially because they really have very little insight into what everyone else around them's value actually is (if they do, then they're probably not paying attention to their own job).
2.3) Partially because the business importance of what they do - either individually, their entire team, or even entire division is likely something only upper management can make a call on (this affects individual salaries because budgets are assigned hierarchically by strategic importance).
2.4) Retention of particular employees is sometimes very strategic - to retain key IP, or retain a rare skill set. The basis for this decision is not necessarily visible to all employees.
3) It's a huge f***ing distraction - people talk about it all the time, and focus on how to use other people's success to leverage a salary negotiation argument, rather than actually trying to do their job better. One person gets a massive bonus or increase for doing a great job, so work grinds to a halt, and half the company is pissed.
4) This has been tried in practice. Government jobs (e.g., national labs in the US), and some "trendy" startups publish all salaries . What is common to all of these is that salary becomes very normalized - for a particular skill set nobody earns to little, and nobody earns to much - incomes are all within a fairly narrow range. This is awesome for under-performers, and terrible for great-performers - so who is encouraged to stay, and who is encouraged to go? What's bad for the business is ultimately bad for you too (well, unless you're the bottom of the barrel). Furthermore, these companies spend an inordinate amount of time formalizing the ranking of the individuals (crazy formulas with arbitrary constants and ratios), in order to explain the inevitable barrage of why is X is paid $1k/year more than Y questions.
Keeping employees in the dark to exploit them is certainly another reason, but it is far from the only reason.