Who knows?
This young man was very disturbed, so trying to figure out what would/wouldn't motivate/trigger him is pretty difficult to predict.
I'll tell you what I think might have prevented this tragedy: the perpetrator had been admitted to a mental health facility, and after 1 day, THEY LET HIM GO.
I really question whether someone like the perpetrator can be evaluated accurately in one day, especially in light of all the warning flags that had been raised about him by students and teachers.
I know it's popular to blame the press for everything

, but, IMO, in this case, there are better places to look for who dropped the ball.