They aren't - in no other situation would anyone be allowed to delete random information off the device of an adult who broke some private rule. The only thing they could generally do is kick you out of wherever you are and tell you to not come back.
They aren't, but you shouldn't delete data in general off a device that isn't yours. Confiscate it like anything else and have the school provide it instead.
If the school cannot provide a necessary resource, that's a larger problem.
Why should a teacher or anyone besides the childs parents have any right to mess with in any way somebody elses property? Students are people not property.