Kate Zernike / New York Times News Service

In the two months since he was found guilty of using a webcam to spy on his roommate, Dharun Ravi has gone from being a symbol of anti-gay bias to being something of a folk hero, with rallies of his supporters urging the court to “free Dharun.”

What may be most surprising is how many of those arguing in his defense are prominent gay-rights advocates.

With Ravi scheduled to be sentenced today, many of them have argued against the prison term prosecutors have recommended. They say Ravi is being punished for the suicide of his roommate, Tyler Clementi, although he was not charged in it, and pinning blame on him ignores the complicated social pressures that drive gay teens to kill themselves.

As repugnant as his behavior was, they say, it was not the blatantly bigoted or threatening actions that typically define hate crimes. Some fear that a sentence that overreaches might provide tinder to anti-gay sentiment — a New Jersey talk-radio host complained soon after the verdict of the “gay lobby” railroading Ravi.

While Clementi’s suicide in September 2010 galvanized public attention on the struggles of gay, lesbian and bisexual teenagers, the question of how to punish Ravi has revealed the deep discomfort that many gay people feel about using the case as a crucible.

“You’re making an example of Ravi in order to send a message to other people who might be bullying, to schools and parents and to prosecutors who have not considered this a crime before,” said Marc Poirier, a law professor at Seton Hall University who is gay and has written about hate-crimes legislation. “That’s a function of criminal law, to condemn as general deterrence. But I think this is a fairly shaky set of facts on which to do it.”

In an op-ed article in The Star-Ledger of Newark, N.J., this month, Jim McGreevey, who resigned as New Jersey’s governor after declaring himself “a gay American,” argued that Ravi’s conviction “showed how far we have traveled from the hateful, homophobic past.”

“The criminal justice system worked, this time for a gay victim,” McGreevey wrote. “But there was something disquieting about the prospect of retributive punishment being meted out on behalf of a gay young man.”

McGreevey, who now counsels prisoners, argued that jail time would neither rehabilitate nor send a message. “Perhaps the long trail of gay history inevitably leads to this call for punishment,” he wrote, “but it need not.”

Ravi set up a webcam to spy on Clementi three weeks into their freshman year at Rutgers University, after Clementi asked to have the room alone so he could be with a man he had recently met on a website for gay men.

Clementi’s suicide three days later prompted an outcry from celebrities and politicians, and pushed New Jersey to pass one of the nation’s strictest anti-bullying laws.

In court, prosecutors used an extensive electronic record to show how Ravi had sent Twitter and text messages declaring that he had seen his roommate “making out with a dude,” and encouraging others to watch. The jury convicted Ravi on all 15 counts, including invasion of privacy, hate crimes and tampering with evidence after he tried to cover up his Twitter trail.

Dan Savage, a gay columnist whose video campaign, “It Gets Better,” began in response to other suicides of gay teenagers just before Clementi, 18, jumped to his death from the George Washington Bridge, argued that simply locking up Ravi was a lost opportunity to talk about the other institutions and people “complicit” in Clementi’s death.

“What was he told about being gay growing up, by his faith leaders, by the media, by the culture?” Savage said. “Ravi may have been the last person who made him feel unsafe and abused and worthless, but he couldn’t have been the first.

“The rush to pin all the responsibility on Ravi and then wash our hands and walk away means we’re not going to learn the lessons of these kids.”