^ I have only read one report about the case, and nothing more. There's a lot that doesn't seem to add up. This is the Reuters piece about it that had a fair amount of facts:
link.
On the one hand, the facts sound a lot like a statutory rape/student-teacher thing. Like X-Codes said. But, the guy was convicted of what is, according to Reuters, Montana's rape offense. Not statutory rape, not sex with a minor, or any similar offense, but rape. Hence the huge penalty that the judge essentially commuted.
I haven't gone directly to the court documents, and I'm a little skeptical that they'd shed a whole lot of light on the matter. It's possible that the judge thought that the defendant was being mischarged -- that it really was more of a statutory rape situation rather than an actual rape one. But, there are much more considered mechanisms in place (JNOV, judgment notwithstanding verdict), and it's not really his call anyway. The jury determines whether all the elements of the rape offense were proven.
EDIT: just realized he pled guilty, wasn't convicted at a trial. Although that sort of confuses me more. He had what looked like a sweetheart deal. They have him pleading guilty to a major crime and are willing to let him off awfully light. And, he couldn't even stick to that? It's weird for the judge to remove the Sword of Damocles the State had to encourage his compliance.
The suicide angle is just added tragedy to what is an already appalling situation. The Reuters article at least didn't seem to over-sensationalize it, though the facts are pretty sensational.
And, I agree with Libertad, I was a bit shocked to read the plea deal. Maybe the evidence against him was really weak? So, prosecutors figured they'd get him off the streets without having to press their luck? That's giving them an awful lot of benefit of the doubt, which isn't exactly supported by my experience.