Earlier quoted context omitted.
Don't ever work in the public sector then. Your salary is public record, open to anyone who is curious enough to look.
I think that's widely understood and part of the job description of being a public servant. What's not widely understood is HR secretly selling your data while working at a private company.
In the private sector, your comp is determined by a negotiation undermined by an asymmetric information disparity. HR at a hiring company has way more information around market comp as it is without having your exact current comp when they make an offer.
What I find particularly egregious about this is that management at this company had admonished me that my comp was 'confidential' and that I shouldn't discuss it, while simultaneously selling it to equifax.