thing's like this tend to happen due to a combination of factors - it's hard to pin down any singular cause.
sure, people don't shoot up schools just because they're bullied. but if they're being bullied at school, live in a toxic household, live in poverty, are genetically predisposed to mental health issues, overconsume violent content etc. then it becomes a lot more likely. none of these factors individually is likely to cause someone to do this, but they each raise the probability of it happening.
point is, and this isn't to deflect responsibility, but it's kind of burying your head in the sand if you look at an event like this and say the school environment is completely innocent. just bullying alone probably wouldn't cause someone to do this, but it most certainly wouldn't help. and if we want to prevent things like this from happening again, then one of the first questions we should be asking is: hey, could the school/government/social services have done anything to get this guy the help he clearly needed.