It's not at all obvious to me that the schools are safer. It depends on who the "guards" are. But I think one could easily argue that the rate of kids getting shot when they could otherwise be constrained using non-lethal means could be comparable to the rate of preventing kids from being killed during a school shooting.
The important variables here are the rates of school shootings (small), the total number of schools (large), the average number of kids saved by an armed guard (questionable, but probably small), and the rate of shooting a kid who's being "aggressive but non-lethal" toward a guard, who then over-reacts (not sure, but non negligible).
But, to be sure, we all recognize that homes with guns are less safe than homes without the, right? I mean, that should be pretty clear by now. The increased rate of suicide alone makes up most of the difference without even counting accidental shootings of family members / neighbors.