I doubt they could legally search your car without cause. It's a different situation when it's your locker on campus. They can search those randomly. That locker belongs to the school and they are allowed to search that for various reasons. Schools are goverment agents but they have more power over what happens on their campus than say the cops would have over a person on the street. They argue that's its in the interest of the school, students, and the community to keep the school safe etc. etc. and that's why they can search your locker. But your vehicle I'm not so sure about. If your vehicle is on school property, eehhhh I don't know if that matters. Police can't search a vehicle without a warrant or probable cause. But like I said, the schools have a strong argument that allows them more power. I should know this, I'm sorry I can't remember everything, it was a while ago that I studied this stuff in school.
But regardless of the argument, that's all thrown out the window when they knowingly let you walk around on campus with it on your pocket. That's almost amusing.
As a recovering "bad kid" in school. I'm just happy you didn't get into more trouble. It might not be worth fighting over, I was your age too. My tendancy would be to Fight the MAN! but you don't want to risk your future for something like this. You have a long life in front of you. Let it go and watch out, your on their radar now.