I agree we will never know the "why" and if someone cobbles something together it will never make sense to a sane/rational person. I suspect someone who is capable of picking up a weapon or multiple weapons and killing many people does not see other people as individuals with value or worth or even necessarily see them as human. They are just targets, blobs, and the goal is to kill as many as possible for the highest count.
I think a several prong approach needs to be looked at in terms of how to start to deal with this kind of phenomena, which only seems to be on the rise.
1. Media blackout: knowing they will be infamous and be on every news station and paper and magazine is a likely lure for these would-be killers. The idea of doing something big and shocking and earth-shattering. All the attention. If only there could be a complete blackout so that it wouldn't give anyone else the idea and/or they would not see someone get famous (or infamous) for their effort.
2. Gun Control: The founding fathers of the country could not possibly have imagined the type of weaponry that would come to exist centuries later when they authored the constitution and wrote the 2nd Amendment. Yes it's true that almost anything can be used as a weapon, but consider that high powered military type guns/rifles kill more people, faster. It's time to come up with strict limits.
3. Odd Goods/Good Odds: Sad to say, but it's true that teen boys up through young men are most likely to commit these kinds of atrocities, statistically-speaking. When the person is odd (mentally ill, obviously), the odds go up that they can be a danger to themselves and others. For goodness sakes, that is the very situation in which a parent should not have weapons, ammunition, etc. It doesn't matter how well locked-up the parents think their guns/ammo are. The kids know about the weapons, they are exposed to them, there is an enticement, excitement, and a potential for something bad. I don't know what can be done to address this, but there seems to be a lot of denial with parents that they have a troubled/odd/weird/socially awkward kid and a kid with mental and/or emotional issues could potentially head down a path of destruction. Parental education? I don't know the answer, but it has to start there.