I think the issue is greater than just schools. There's a disturbing trend in the last few years of more shootings in general, not simply restricted to schools. All of them are getting much better publicity than ever before, too.
I hate to put it so simply, but I think that increased publicity is exactly the problem, or at least part of it. Anyone going in to do this kind of thing knows beforehand, that successful or not, devastating or not, their name is going to be plastered all over the nation (and even world) for days afterward.
For someone already going to off themselves, that's an incentive to make it bigger.
Now, don't mistake that as a reason for all of them, or probably even a majority of them. I am, however, fairly sure that in at least a few cases, the guaranteed publicity from such an act was enough to "upgrade" it from a mere suicide to a mass shooting.