the problem starts at the family level first. raising your children and being involved in their lives and teaching them good morals and values.

personally I chose and choose to take 'family' very serious and the foundation of society.
the next thing is the institution itself .. you really think locking a bunch of 12 year old kids up together with other 12 year old kids in rooms of 40 kids for 8 hours per day 5 days per week is good for their mental health .. probably not. its like a prison and does not support good social or life skills.
this is why I chose to homeschool my kids for the most part.
I think some parents are distant from their children and drop them off into this prison like school system for 8 hours a day just so they can go do the things that they want to do and they use it as a state babysitter.. if parents were just more hands on and involved in their children's lives that would limit school shootings big time.
also if schools were not so institutional like prisons that would help .. let more learning be done at home with parent involvement, not be stuck in an institution system 40 hours per week
also , its not a "gun problem" . heck 60 years ago kids would have guns mounted in the back of their pickups cause after school ended they were going to go hunting.. they used to have target shooting in class and rifles were kept in lockers. there were plenty of guns around back then in schools yet there were no school shootings .. so something else changed over time , the moral fabric of family and society is what changed, guns in and of themselves were never the problem