Brody Luke Anderson has been found guilty of two counts of intentionally recording an intimate image without consent.
The Newcastle Local Court heard the charges did not relate to a student at the school.
He was spared jail but ordered to serve a two-year sentence in the community.
A teacher has been spared jail but is banned from working in any NSW public school after taking photos of a naked sleeping man.
Brody Luke Anderson, who taught at a school in the wider Hunter region, was found guilty of two counts of intentionally recording an intimate image without consent.
The Newcastle Local Court heard the charges did not relate to a student at the school.
Ahead of sentencing on Tuesday, Anderson wrote a letter to Judge Georgina Darcy apologising for his actions.
"I am truly sorry for the hurt I have caused. This will not happen again," he said.
The ABC has since learned he has been barred from teaching at any NSW public school.
Police facts tendered in court said Anderson took two images of an adult man lying naked on a bed in a Sydney hotel room in March 2024.
"The victim was asleep in the bed, laying in the fetal position completely naked with his buttocks exposed," the fact sheet said.