Kirk Matheson, 37, was the principal and volleyball coach at North and South Esk Regional High School in Sunny Corner when he posed as a 19-year-old woman on Facebook and enticed two boys to send him nude photos and video of themselves.
He pleaded guilty to using a computer to contact two underage boys, in separate incidents, for the purpose of creating child pornography between February and April.
Provincial court Judge John Friel said luring vulnerable children is heinous as Matheson sat quietly.
The judge said he didn't believe Matheson's defence that he was confused over his own sexuality, but said he is satisfied Matheson has learned his lesson.
Friel also noted that Matheson did not attempt to meet the two 17-year-old boys in person.
Crown prosecutor Karen Lee Lamrock told reporters outside the courtroom a serious aggravating factor contributed to the judge's sentence.
"Mr. Matheson was the principal at the school that the victims attended, and he used that position in order to better get to know his victims," she said. "That was in fact a breach of trust and breach of his position of trust."
Matheson was also sentenced to an additional 15 days for breaching a court order to not have any unsupervised contact with his niece and nephew.
Once released, Matheson will be under supervised probation for two years with eight strict conditions, including reporting to a probation officer, attending rehabilitation programs, not having access to a computer or handheld devices with access to the internet, and consenting to allow police to search his home and vehicle without a warrant.
In addition, Matheson will have to provide a DNA sample to authorities and will be on the national sex offenders registry for life, the judge ruled.
As Matheson was led out of the courtroom, his mother began to cry and told him to "hang tough."
Crown recommended 2 years
Matheson was supposed to be sentenced earlier this month. The Crown had recommended Matheson serve two years in prison for the crimes when they were in court earlier in November.
However, the defence said Matheson loved teaching and had high morals, but had trouble accepting he was gay, which led him to have substance-abuse problems.
The defence also argued Matheson has been traumatized by the ordeal.
Matheson, who was arrested at his home on April 20, has not been in custody while awaiting sentencing.
But the court ordered him to follow strict conditions, including staying away from the school, having no direct or indirect contact with anyone under the age of 18, with the exception of his niece and nephew in the presence of one of their parents, and not to use a computer or any other data-sharing device.