Guns are a problem, but so is the internet. It isn't a coincidence that the era of regular mass shootings has coincided with the internet age, where people can idolize acts of violence, connect to other frustrated and dangerous people, and get encouragement in their hatred.
Excellent. This angle isn't mentioned nearly often enough. Too much online wrangling over the demographics of the shooters, over wording, use of the term "terrorist" etc. All of this just exacerbates the core problem.
It isn't just that the internet is a gateway to toxic ideological systems, though this certainly doesn't help. It's that the internet has a naturally isolating effect on people, young people especially. I wasn't on Facebook when I was a teenager or in my twenties. I was out partying and so on. This had a number of effects. I saw and met many different people from different walks of life. Of different political persuasion, race, ethnicity, and so on. So I had real world experience with a lot of different kinds of people. As a consequence, you learn that they're not all monsters, terrorists, they don't all have unearned privilege, etc. You saw and interacted with these different types of people, and so your capacity for empathy was usually, though not always greater. There were tribes, cliques, etc. But not like the tribalism we're seeing on social media. You had your opinions, but learned to get along more cordially with people who didn't share those opinions because you really didn't have much of a choice. Especially if your views were off the beaten path. This had an overall moderating effect on the way people thought. Plus isolated and alienated youth are that much more prone to radicalization to begin with.
Contrast this with a kid who doesn't get out much because he's online all the time. His knowledge of people outside his favorite hugboxes is going to be skewed by the prevailing sentiments within said hugboxes. If those views are that all blacks have low I.Qs, all Muslims are terrorists hell bent on demographic conquest of the west, all men are rapists, all whites are Nazis etc, then you damn well tow the line, or you'll get blasted. In the worst cases, dissent is the death of the poor kid's social life. They become trapped in ideological systems that have long since mastered the art of demonizing outsiders as a means of cementing in-group loyalty. You can forget having a rational conversation with them. Interactions with out-groups are almost always exercises in frustration and anger, as different ideologues who insult and troll one another are powerless to really take things to the next level. In the real world, a good old knock down drag out fist fight solved the worst problems like this. Not any more. Anger with some snarky, smug asshat on the other side of the political isle just festers and festers and builds and builds. Hell, prior to the proliferation of the internet, one did not simply join a neo Nazi or white supremacist organization. You couldn't just enter "Ku Klux Klan" in your search engine and actually be a registered member five minutes later. You actually had to know where to look, and be a determined ideological believer in that sort of thing. Which was that much harder due to the lack of access to their ideas.
Someone above mentioned incels. Another thing you have way fewer chances to do online is meet prospective dates. The US political spectrum is EXTREMELY gendered and fueled in large degree by sexual and romantic frustration. The left is very gynocentric and misandrist, while angry young men thus drift to the far right, with its fetishization of restored macho masculinity. Sexual frustration is easily channeled into acts of political militancy. Read Orwell's 1984 for a more detailed look at how this happens.
Add to that everything else we've already discussed, ease of access of firearms especially and I'm surprised there isn't more politically motivated violence than there is at present.