Based on the testimony of the prosecution's own witnesses, the motivation for what Clementi called Ravi's "five sec peep" was twofold: He was curious about whether he had correctly surmised Clementi was gay, and he worried that Clementi's visitor, an older man who was not a student and struck him as sketchy, might steal his stuff.
The prosecution witnesses agreed that Ravi -- who, judging from his many indiscreet tweets and instant messages, was not shy about sharing his opinions -- had never expressed hostility against gay people in general or Clementi in particular. As far as Ravi was concerned, these students said, the scandalous thing about Clementi's tryst was his visitor's age, not his sex. "He's not homophobic," Ravi's lawyer declared during his opening statement. "He's not anti-gay."
The testimony and public record so far support that portrayal. But you can be sure that if Ravi had ever said, "Man, I hate queers," or even endorsed the biblical view of homosexuality, that statement would be used against him and might be crucial in winning a conviction. In that case, he would be punished not just for what he did but also for what he believes.
The legal treatment of Ravi, who probably would not have been charged at all if Clementi had not killed himself, has been unreasonably harsh. But even people who commit far worse crimes should not face extra punishment because they harbor unenlightened views.