If you publish your salaries, and along comes a super-talented programmer who asks for more than standard, but has unique talents that don't really fit on the standard "scale", then you can bring them on board, without creating resentment, etc.
I've worked at a company with standardized salaries, that lost out on hiring the best programmers, simply because their salary system (everybody's titles linked to salary grades everyone knew) was too inflexible.
So you're bringing somebody exceptional on who will create some amount of value, and you're willing to compensate them appropriately for that. But wait, the rest of your team will be resentful!
There are two possibilities here: 1) You're paying everyone else less than they're worth to you, in which case they should be resentful; or, 2) You're paying everyone else what you think they're worth to you, but you're unable to convince them of that, in which case your problem isn't that your employees know each others' salaries, your problem is that your employees don't trust your judgment-- or perhaps that you have poor judgment.
Of course any compensation program which isn't flexible enough to appropriately reward employees for the value they create is flawed, but that has nothing to do with whether or not those rewards are public. In fact, I'd argue that a traditional system where compensation is determined by closed-door negotiations with asymmetric information is uniquely unlikely to do so appropriately.
Personally, I've shared my salary with like-minded coworkers willing to help each other negotiate the best terms. Never shared with most people, however, because they've internalized irrational ideological barriers to doing things like this.