They're all locked so you can't get in and usually have signals that go off if someone opens them from the inside. Many schools even have metal detectors. This is a large high school. I can't imagine that these security precautions weren't in place.
Back when I substituted (until five years ago), I was very cognizant of security precautions, having to adjust to different systems every day. What I've described is the minimum, precautions all schools have or should have in place, especially after Sandy Hook demonstrated it can happen anywhere.
In this case, Cruz, was a former student who knew when everything would be open, dismissal. He simply walked past the moms in the car pool lane, into the building, pulled the fire alarm, and openeded up like rats in a barrel. He then dropped the gun, and ran out w the rest with his hands in the air w the rest, and walked away.