This happened at my last company before I started working there. Amazingly, the person who caused this to happen wasn't fired, which just solidified in the minds of all workers that the company plays favorites (given that some people are fired when they slip up a tiny bit, and other people can do the below & keep their job).
What did she do? Well, she was an HR person, and she accidentally sent out an email that had an attachment that listed the salary of every. single. person. in the corporate office.
On a similar note, at another previous job, I found out the salary of every single person in my department. What happened was totally not my fault. When my boss was forced out of the company (they eliminated her position because they were planning on selling the company, so they were getting rid of as many expenses as possible, and put my department under someone else), nobody cleaned out her office. I needed the form to submit payment for a freelancer that I had. When I asked an Executive Assistant about it, she told me that it should be in my bosses office, in one of her desk drawers & that I could just get it myself. It didn't occur to me that they wouldn't have cleaned out the confidential stuff (and her old office was always open & accessible). As I was going through looking for the forms I found the sheet with all the salaries.
I didn't know what to do, and I really didn't want to tell HR what I found, so I put it back, and then sent an email to HR asking if/when someone was going to clean out her desk, because of possible confidential information left behind. Someone did it the next day.
Seeing the salaries was an eye-opening experience. It left a nasty taste in my mouth, because some of my coworkers were *really* get screwed. Definitely a lot of favoritism at that company, too.