These points are not in contradiction. You can publish anonymized salary information which gives other professionals accurate information about their market value while at the same time protecting employees against abuses of power where individual HR data becomes available to third parties.
For example, Tekna, the Norwegian Technical and scientific professionals' society, publishes annual (anonymized) salary surveys which are categorized by percentile, length of work experience and public vs. private sector. A software developers' "union" could easily provide similar statistics, perhaps organized by specialty. What you need to publish for transparency is enough information to ensure that new employees don't get a raw deal, not individualized information.
For example, Tekna, the Norwegian Technical and scientific professionals' society, publishes annual (anonymized) salary surveys which are categorized by percentile, length of work experience and public vs. private sector. A software developers' "union" could easily provide similar statistics, perhaps organized by specialty. What you need to publish for transparency is enough information to ensure that new employees don't get a raw deal, not individualized information.