Hello and welcome to JustAnswer. Please note: This is general information for educational purposes only and is not legal advice. No specific course of action is proposed herein, and no attorney-client relationship or privilege is formed by speaking to an expert on this site. By continuing, you confirm that you understand and agree to these terms.
I am sorry to hear about this situation. On this website, I do not always get to give good news, and this is one of these times.
The school stands in loco parentis, meaning that it has most of a parent's powers while the student is under the school's care. And the school shares, in matters of school discipline, the parent's right to use moderate force to obtain obedience as well as perform searches of students' items. See In re Donaldson, 269 Cal. App. 2d 509 - Cal: Court of Appeal 1969.
While no case precedent discusses phones in California specifically, the courts have okay'd the schools searching lockers and bag packs as long as it was for purposes of discipline and maintaining order. Even if the cell was yours, the school will likely try to justify that the search the phone for improper text messages and photos as part of school discipline.
Is this taking it too far? Maybe. However the Court has not yet made a precedent decisions about this in CA, leaving this subjective. The presumption is that it was proper(under justification of discipline) until/unless you challenge this in Court, and the Court agrees.
Please note: If I tell you simply what you wish to hear, this would be unfair to you. I need to be honest with you and sometimes this means providing information that is not optimal. Negative ratings are reserved for experts who are rude or for erroneous information. Please rate me on the quality of my information; do not punish me for my honesty.
I hope this helps and clarifies. Please use the SEND or REPLY button to keep chatting, or please RATE when finished. You may always ask follow ups at no charge after rating. Kindly rate my answer as one of TOP THREE FACES/STARS and then SUBMIT, as this is how experts get credit for our time. Rating my answer the bottom two faces/stars (or failing to submit the rating) does not give me credit and reflects poorly on me, even if my answer is correct. I work very hard to formulate an informative and honest answer for you; please reciprocate my good faith with a positive rating.