They say that because they don't want underpaid workers to realize they're underpaid. It has nothing to do with preventing drama or resentment.
Yes, of course I talk to my coworkers about my wage. We should all have some type of awareness of what people who do similar work are making. It can only benefit the employee.
This. Here in Germany, until a few years ago, discussing your salary used to be unlawful, and a reason for termination. Then someone filed a lawsuit an won, and now it's allowed. But of course bosses hate this fact, and during salary negotiations they emphasize that salaries are NOT to be discussed and yadda yadda.
Same at my company. But in my opinion, if you know that you pay some people much worse than others, and don't want them to find out: FUCK YOU! You deserve that people give you the finger and go work someplace else because they find out you're lowballing them. Treat your staff fairly, have happy employees. Don't forget that, yes, you pay your employees' salaries, but the employees work to earn YOUR salary, too.
I have coworkers I trust and discuss my salary with, but they are also my friends. We started at the company at around the same time, but we have ended up in different areas of the business, and we've talked about how our salaries have evolved or not, and based on that we've all gone and talked to our boss, after finding out that one of them was getting royally fucked. And our boss knew we had talked, and he was pissed off, but we've told him that we were even more pissed off because he was lowballing us.
I do have coworkers who I don't like a whole lot, who I would never discuss my salary with, because I think I probably make like a thousand bucks more than them per month, and if I told them, everyone would be mad at everyone, and I have no reason to create an unnecessary shitstorm that might end with me getting the boot. No thanks.