Reminds me of when I accidentally left a knife in my shorts pocket from fishing. I went to the principals office, and explained the situation, I never got in trouble before besides 1 detention because I skipped a class, and I played two varsity sports.
My principal took the knife, stuck it in his middle desk drawer, told me to come get it at the end of the day when I was leaving.
Technically according to the student rule book I should have been expelled, but clearly it was a slip of the mind, I fessed up, and he took care of me.
Not saying its exactly the same with a gun, but the prinicpal shouldn't have acted the way he did. The student was honest, it was a simple mistake, no one was in harm, they gun could have been easily removed, by one adult or another before lunch period and end of story.