The right to self-defense is a fundamental right of any human any supersedes law or governments. There is no logical connection between that right and that some people have misused firearms and shot up schools. From James Bovard at fff.org:
School shootings have become the latest pretext for politicians to destroy the Second Amendment. Mayor Pete Buttigieg of South Bend, Indiana, declared in a Democratic presidential candidates’ debate, “I was part of the first generation that saw routine school shootings. We have now produced the second school-shooting generation in this country. We dare not allow there to be a third.” Another Democratic presidential candidate, Rep. Eric Swalwell (D-Cal.), invoked school shootings to justify confiscating millions of firearms across the nation: “It’s not just the violence that they’ve caused; it’s the fear, the immeasurable fear that our children live in because they are still on our streets. I want to get rid of that fear.”
In reality, despite a tidal wave of misleading propaganda, the number of school shootings has fallen sharply over the past 30 years. But anti-gun activists in government and the media have done their best to persuade people otherwise.