It's kind of like how most people aren't going to just ask their spouse if they're cheating, they'll wait until the evidence is clear. Nobody wants to confront the potentially ugly truth.
I don't think you can actually assert that this is what people actually want on a meaningful psychological level. They're certainly scared away from doing it with unenforceable lines banning it in contracts, TV shows skirting away from mentioning salary figures at all times, etc.
The word taboo is fitting precisely because of this.
To use a childish simile, it's just like how most guys won't actually say how big their dick is, even if they'll talk about the general topic. It's not because it's "taboo", it's because they don't want to find out that their best friend is bigger.
I'm not taking a position on which side is better or worse, just noting that whether you aim to get richer than your neighbour is probably going to be the main thing determining whether you think salaries should be public or private.
I wonder when it started? Somehow I can't imagine 19th century Americans being so secretive about how much they're making.