On the nesw they had one school that ALMOST had it right, all doors are locked, you can only get into ONE door, and must provide ID.. of course if the assailant is a student (Columbine) that system doesn't work well. ANd of course they showed the teacher (I assume) opening the door to check their ID's, so they lost their security against an unknown intruder at that point, of course the chances are she knew the students, and opened the door to greet them as they dug out their ID's.
I don't know how to make a school perfectly secure where you can prevent EVERY psycho with delusions of fame from getting into a school armed, so you must prepare for the event when one does get in.