Public servants have a progression table, so by knowing their level, you know the salary.
Companies either have an union agreement, so it goes back to the same level agreements, or they have internal evaluation with salary matrix, so again by knowing department and skill level, it is relatively easy to get the salary value, minus possible bonus.
They are even part of some job offer descriptions.
So at the end of the day it is hard to grasp why it is so sacred to discuss it on US.