Maybe the school was tipped off....kids could easily surreptitiously record it. It would be very bad for the school. Could teacher be considered sexually harassing the students if students don’t want to hear the text? Could the school be liable for allowing the teacher to do that? If a man in a school starts reading porno to a girl against her will, that is harassment.
These things can be dealt with without having police raid the classrooms looking for objectionable material.