The case began in September 2010 when Ravi’s randomly assigned freshman-year roommate asked Ravi for the room alone so that he and guest could have privacy. Ravi went to a friend’s room and turned on his webcam remotely, and they saw Clementi and his guest kissing.

They told others about it through instant messages and tweets, with Ravi tweeting: “I saw him making out with a dude. Yay.”

When Clementi asked for privacy again two days later, Ravi agreed, then told friends how to access his webcam. But this time, the camera was not on when the guest came over. There was testimony both that Clementi unplugged it and that Ravi himself put it to sleep.

The next night, Clementi—who had learned he had been spied on—committed suicide at age 18, leaving behind a final Facebook update: “jumping off the GW bridge, sorry.”

After the suicide, gay-rights and anti-bullying activists held up Clementi as an example of the consequences of bullying young gays. President Barack Obama himself spoke about the tragedy.

In handing down the sentence, the judge told Ravi that while someone might argue the first spying attempt was a foolish prank, “You cannot make or milk that argument a second time.”

The judge also berated Ravi for deleting scores of text messages and tweets and trying to influence a witness. At the same time, Berman said Ravi has spent the past 20 months in “exile” since his arrest. And the judge also pointed out that Ravi was not charged in Clementi’s death.

Ravi did not speak at his sentencing. But his mother, Sabitha Ravi, told the judge her son “doesn’t have any hatred in his heart towards anybody.”

Clementi’s father, Joe Clementi, told the judge that Ravi deserved to be punished, saying the young man saw his son as undeserving of basic human decency. The elder Clementi said Ravi “still does not get it” and has no remorse.

Prosecutors had offered Ravi a plea bargain that called for no prison time. He turned it down.

After a trial that lasted four weeks, Ravi was convicted of all 15 charges against him, including invasion of privacy, anti-gay intimidation, and trying to cover his tracks by destroying text messages and tweets and tampering with a witness.

Just as Clementi became a symbol for a complicated cause, so has Ravi. Some have portrayed the case as a tragic lesson in unintended consequences and the dangers of the Internet in the hands of young people.

Several hundred Ravi supporters rallied at New Jersey’s Statehouse last week to denounce the way the state’s hate-crime laws were being used on someone they said was not hateful.

They were hoping Ravi would not be sent to prison and that the law could be changed so that someone in his situation again would not be found to have committed a hate crime.