The battle over the Defense of Marriage Act took two wild turns today. Under heavy pressure, the law firm that had agreed to defend it in court for the House GOP, King and Spalding, pulled out of the case. That looked like a blow to the House GOP’s effort to defend the law, but then the partner who had been tapped to lead the defense, Paul Clement, resigned from the firm in protest and said he would continue on the case.

Clement said in his statement that lawyers must be willing to defend “unpopular causes.”

I just got off the phone with leading gay rights advocate Richard Socarides, who had led the charge against the firm, and he tore into the decision by Clement — the Solicitor General under George W. Bush — by pointing out that it’s folly to present this as a principled stance.

“He tries to make the case that lawyers should represent unpopular causes — but this is not merely an unpopular cause, this is an un-American cause,” Socarides said. “If a lawyer represents an unpopular client who’s defending an important principle, that is what the legal system is about. If the client is unpopular but the principle is important, then it’s important to do.”

“But this is not an important principle,” Socarides continued. “The only principle he wishes to defend is discrimination and second class citizenship for gay Americans. It’s very wrong.”

Socarides made an important point: Even if the House GOP will be able to continue its defense of the law, the decision by King and Spalding signals that defending opposition to gay marriage is now politically toxic with the mainstream, a clear sign of the shift in public opinion on gay rights.

“For a big law firm with an international reputation like King and Spalding, this could have gotten very ugly for them,” Socarides said. ”This kind of thing could have stuck to them for decades. People no longer want to be associated with this kind of discrimination. A firm like this competes at all the top law schools to recruit all the top students. I’m sure they took a look at this and said, `What do we need this for?’”