ID cards! No one, who is not scheduled to be at a school should be allowed in. If someone, who is not scheduled to be at the school should be dealt with by a resource officer employed by the school.
BUT, it appears, from reports, that the shooting happened as morning announcements were being made and the school was most likely not completely locked down yet (school buses running late, parents running late, etc...). It doesn't appear to be any fault of the school's or lack of security during school hours, but two people who knew the loopholes at the school to carry out the most horrific plan of attack that I have seen since 911.