IMO I feel like they feel they have been wronged so want to take out those individuals. Wronged could mean any number of things depending on what had gone on in the shooters life, and where/who he was taking out. Were they mean? Did he feel like they were ganging up against him when in fact it was simply a matter of workers handling an HR issue (He didn't work out in the job so was being cut loose for whatever reasons) and he took it personal? I think it's human nature to do that. It's like self-preservation for the mind. People don't like being wrong so whatever he was (likely) written up about, while fact to the supervisors, wasn't true in his mind, so therefore it's their fault, or they are mean, or they didn't like me, etc.
There can be a while variety of reasons for wanting to take others out and not only die by suicide and leave others be. I feel they snap from whatever the stressors are, and want to hurt others like they are hurting. I also believe it's done in anger, not like they want to be glorified monsters. Well, some do. Take Columbine for instance.
If it wasn't obvious... all that was MOO. I'm not a psychiatrist or other professional.

It's just how things make sense to me when I think about why some people might do these sorts of things.
Here is a snippet the the link below on understanding why some do mass shootings. Sub "school teachers" for "bankers" or "peers" since it's not just happening in schools.
School shooters tend to act impulsively and attack the targets of their rage: students and faculty. But Harris and Klebold planned for a year and dreamed much bigger. The school served as means to a grander end, to terrorize the entire nation by attacking a symbol of American life. Their slaughter was aimed at students and teachers, but it was not motivated by resentment of them in particular. Students and teachers were just convenient quarry, what Timothy McVeigh described as “collateral damage.”
Most Americans have reached one of two wrong conclusions.
slate.com