I used to think about shooting up my high school when I was a teenager, it's not something I'm proud of. But it was something I thought about.
Many of these guys are depressed loners or outcasts who are prone to be suicidal thinking that their life is meaningless. This leads to them being angry that they were made to feel this way by those who've tormented them and see it as their duty to get revenge. Rather than commit suicide, they take others out with them- sometimes it gets out of hand, sometimes it doesn't. Columbine for example, from research, was not meant to be as random as it was; they did have a 'hit list' in their diaries.
Start seeing yourself, in a twisted way, as a martyr. Take out those who have made your life hell and may make other lives hell. As Dylan stated, "they are just testing my trigger finger."
I'm not proud that I did use to think this way, but I do understand where these high school shooters are coming from because I was sadly on the edge of becoming one myself years ago.
I wrote an episode for a virtual series I work for that I will posting some time later tonight with commentary and all in the 'fan fiction' section of the hype. Might put a little more insight into this whole thing.
It's sad and scary that it happens, but from my eyes in most high school shootings everyone's a victim because they are- more or less- suicide pacts.