Judge G. Todd Baugh of Billings said the 31-day jail term with 14 years probation was "the right kind of sentence" in the case against teacher Stacey Dean Rambold, 47.
Prosecutors said Rambold had sex with a 14-year-old student, Cherise Morales, in 2008. When Morales confided in a church group leader about her relationship with Rambold, police were notified and he was arrested and fired.
Morales committed suicide in 2010.
Rambold reached a deferred deal with prosecutors to undergo sex offender counseling and abide by other restrictions, including giving up his teaching license. When prosecutors said Rambold failed to attend some counseling sessions and violated other terms of his deferred sentence, they moved ahead with prosecution.
At sentencing in August, Baugh drew sharp criticism for what many said was his blaming Morales for the incident when he said she looked older than she was and was "probably as much in control of the situation as was the defendant."
Baugh apologized for the remark but stood by his decision to sentence Rambold to just 31 days in prison.
Baugh's decision has been appealed by the Montana Attorney General's Office. In legal documents made public this week, Baugh continued to defend his decision despite prosecutors seeking a prison sentence of 10 years, CNN reported Wednesday.
"The defendant's last legal or moral transgression was the crime he committed and admitted," he wrote. "In the ensuing almost six years, he had legally and morally good conduct, he was reinstated in sex offender treatment and the undisputed evidence supported community placement and treatment."