I don't know how any teacher will survive a full career with everyone being a spy photographing everything. This student assaulted the teacher. The teacher has a right to anger and self defense.
Keep in mind the teacher is liable for the safety of other students, and has to respond immediately to threats.