Advocates of legalized prostitution took their challenge to California’s 145-year-old ban on commercial sex before a federal appeals court Thursday and appeared to get a hint that they’ll have another chance to show why the law should be cast aside.

The case was brought by three former prostitutes, a would-be client and the Erotic Service Providers Legal, Educational and Research Project. They contend the law violates the right to engage in consensual sex, as defined by the U.S. Supreme Court in a 2003 ruling overturning criminal laws against gay sexual activity.

U.S. District Judge Jeffrey White of Oakland rejected their argument last year, saying the high court ruling protected only intimate personal relationships, not commercial sex. He said the state had adequately justified the current law as a deterrent to violence against women, sexually transmitted diseases and human trafficking.

But at Thursday’s hearing, members of a three-judge panel of the Ninth U.S. Circuit Court of Appeals in San Francisco suggested that the law might need closer scrutiny, given today’s less restrictive standards, as recognized by the high court, on sex between consenting adults.

“Why should it be illegal to sell something that it’s legal to give away?” asked Carlos Bea, one of the court’s most conservative judges.

Another conservative, Judge Consuelo Callahan, pointed out that prostitution, like gay sex, had historically been “subject to moral disapproval.” Just as in 2003, the current case, she said, “deals with individuals’ rights,” so why wouldn’t a ruling for the right to engage in prostitution be “a natural extension of Supreme Court precedent?”

Deputy Attorney General Sharon O’Grady, the state’s lawyer, responded that the difference is in “the commercial aspect … the commodification of sex.”

“The state is not telling anyone who they can sleep with,” O’Grady said. It is prohibiting only a harmful category of business transactions, not intimate or enduring relationships, she said.

But Bea said the 2003 Supreme Court ruling might require the court to send the case back to White for another review, and perhaps even a full-scale trial, in which the state would have to show a compelling need for the law.

The Supreme Court’s 2003 decision established “the right of individuals to make their own individual choices as to how they want to behave” in consensual sexual relationships, Sirkin told the court. “If people put a dollar amount on it, that should not alter the intimate relationship.”

But Bea questioned whether the high court’s ruling applied to “totally anonymous sex” for hire. And the third panel member, Jane Restani, a judge from the U.S. Court of International Trade temporarily assigned to the appeals court, noted that Justice Anthony Kennedy, in the 2003 Supreme Court ruling, had specified that the case before the court did not involve prostitution.

On the other hand, Bea quoted from another portion of the 2003 case in which the late Justice Antonin Scalia, writing in dissent, declared that the ruling “called into question” state laws against prostitution.

True, said O’Grady, the state’s lawyer — but Scalia, in the same opinion, also predicted the ruling would be used to strike down laws against incest and bestiality.

Full story at SF Gate.