People don't carry guns nearly everywhere, and schools do have security. Most people committing these crimes WANT there to be security so they can go out in a blaze of glory or get their 15 minutes once they're caught.
IMO, this latest incident pretty much proves once and for all that the problem is not background checks and wait periods. These systems are designed to fail. The problem is having these machines of death available AT ALL. Unless you are part of the military or law enforcement, you have no business whatsoever with an AR-15 or similar weapons.
Most mass shooters shoot in places where there's not security because they want to, you know, kill people. Most of them also kill themselves after or after the cops catch up to them. Schools don't have that much security or armed guards or xops. If they did, they would have less shootings.