I am assuming this is a public school, so use of an iPhone in a public place is permitted. Now, if this is a private school, then check the policy in place signed by the users.
I don't see anything illegal about what the teacher did. It does not seem like they were doing so with an impermissible purpose based on the facts provided.
This is not legal advice nor does it create an attorney-client relationship. This is for education and informational purposes only. It is always recommended that you contact an attorney with any concerns as each individual case is unique.