The married man, who was diagnosed with paedophilia after his arrest, preyed on the boys between 2016 and 2017, until one of them lodged a police report.
He began with a 14-year-old boy in May 2016, who had been sent for detention over using his phone to circulate pornographic photos in his class's WhatsApp group.
When the teacher found out the reason for his detention, he asked the younger boy if he wanted to watch pornography together with him.