He is accused of secretly recording students in the locker rooms at two high schools and in the bathroom of a middle school, police say.