EARLIER THIS year, the Obama administration announced that it would not defend against court challenge the Defense of Marriage Act (DOMA), which bars federal recognition of same-sex marriages. The administration said the law is discriminatory and unconstitutional.

Congressional Republicans were incensed at what they saw as the Justice Department’s abdication of its duty to defend the law of the land. Last week, the House announced that, to defend the statute, it had hired the law firm of King & Spalding and one of its stars, former Bush solicitor general Paul D. Clement.

The Human Rights Campaign — perhaps the premier gay rights organization in the country — took offense and went on the offensive. According to its own account, HRC “contacted many of the firm’s clients, LGBT student groups at top law schools and used social media to inform the public about K&S’s wrongheaded decision.” The move was clearly meant to pressure and intimidate the firm — and it worked. On Monday, King & Spalding announced that it would not represent the House after all. Mr. Clement resigned, taking the DOMA case with him to a much smaller firm in Washington.

HRC is right to fight vigorously to overturn DOMA, which deprives gays and lesbians of many of the rights enjoyed by their heterosexual counterparts. But it sullies itself and its cause by resorting to bullying tactics.

The group’s attack called to mind last year’s assault on Justice Department lawyers who had in private practice represented detainees at the U.S. naval base in Guantanamo Bay, Cuba. “Who are these government officials? . . . Whose values do they share?” asked a video produced by the conservative group Keep America Safe, which questioned the patriotism and loyalty of the “al Qaeda 7 lawyers.” Never mind that these attorneys were acting in the best traditions of the country by representing even those accused of the most heinous acts. HRC similarly branded King & Spalding with the political views of its client and set out to make the firm pay.

Law firms are not obligated to take on every person or organization that seeks help. In a statement, King & Spalding cast doubt on whether Mr. Clement followed the firm’s process for vetting new clients and strongly suggested that the DOMA case would not have passed muster had procedures been followed. But the firm had a contract with the House — and an obligation to act in the client’s best interest. This King & Spalding did not do, choosing instead to cut loose an unpopular client once the criticism became too intense.

Not so long ago many lawyers would refuse to represent openly gay clients for fear of ruining their careers. It was wrong then to give in to pressure, and it’s wrong now. HRC and King & Spalding seem to have forgotten this.