They certainly shouldn't have done it, but it's a stupid law.
Stupid.
It may be a stupid law. Personally, I am quite alright with the notion that minors should not be taking guns to school where they are then in the charge of somebody else. I know I would not want to have to be responsible for kids I don't personally know really well having firearms. It puts the school in a tricky legal position if there is a problem. Why, because if there is a problem and somebody gets hurt, the family of the hurt student isn't going to sue the other child for the transgression. They are going to sue the school district.
Fortunately in the case of Columbine, part of the reason that the suits against the school were thrown out stemmed from the school having rules in place forbidding guns on campus. In other words, the school didn't allow the event to happen by allowing kids to bring guns to school. The judge apparently and rightfully understood this.
However, in many school shootings, families of the victims sue the school and for all sorts of stupid reasons. The success of such suits depends, in part on which rules and laws are in place and whether or not the school is in compliance with them. Heck, the school was named in a lawsuit when Lawrence Kind was shot twice (later died) by another student who shot King for being gay. The claim? The school should not have let King wear girls' clothing and makeup that result in drawing negative attention to King and resulted in his death. Fortunately, there was law in place protecting the school. They could not force King to wear the gender specific clothing because of hate crime law that prevented such gender discrimination.
People want to sue. It is sad, but seems to be true. You can go back and look at school shootings in the last 20 years or so and see that suits were brought against the schools, districts, and/or boards in all (that I have read over thus far) elementary, middle, and high school shootings where a student was the shooter - certainly in some college shootings as well. Of course the shooter or his/her family (if a minor) should be responsible, you would think, and have to pay, but they often don't have the deep pockets of a school district that is tied to a city or county and hence has the potential for a very large settlement.
Think about it. When was the last time somebody was killed in a school shooting that the parents or family of the victims just considered the whole event an unfortunately tragedy and didn't try to exact some sort of compensation out of the school?