The locker is school property, the cell phone is not.
School bags aren’t school property either. Nor are the cars in the parking lot, yet both may be searched.