Well, Now That You Mention It....
The reveal/hide scale is so wide, it's amazing. I've worked in jobs where everyone knew what everyone else got, and not just in the military. It was pretty much a 'meh. So what' situation.
I've also worked for companies where even the mere mention of what you made to another employee was a firing offense. I didn't work at those companies very long. They almost all underpaid all but a very few 'special' employees and managers.
My favorite places found a middle ground; You may tell anyone you want what you are paid. You may NOT tell anyone else what SOMEONE ELSE is paid without their expressed permission.
That seemed to work out pretty well.