Give bullied kids no other out, and they will use extremes when they feel they have nothing left to lose. All the interim behaviours between 'taking it' and the nuclear option have been removed from play, and society routinely shows images in media of people killing their way out of a relatively minor problem.
I have no idea how this kid was treated, even though comments seem to indicate it was bad, and common knowledge. Where were the school administrators, teachers? snickering into their masks? Where were the parents? Didn't they notice something going on with their kid?
It is no excuse for shooting people, but the kid apparently snapped. Something like that usually takes a long term buildup, so there is a chance this could have been prevented if someone had taken the time to recognize it and act appropriately.
But whatever the case may be with the shooter, the overwhelming majority of guns in America were not used to injure anyone, so why punish their owners?