A salary is the contract between the employer and the employee, it should remain a secret unless one of the two wants to disclose it.
And frankly, not a lot of people can handle being told they aren't as good as their coworker, which is why they make less.