IN 2007, EDITH Windsor married Thea Spyer, her partner of 42 years, in Canada. Two years later, Ms. Spyer died. If the New York couple had been been man and woman, Ms. Windsor wouldn’t have been hit with a big estate tax bill. But they were two women, and the Defense of Marriage Act (DOMA) prohibited the federal government from recognizing their relationship. Ms. Windsor owed the Internal Revenue Service $363,053.

No government interest could justify such punitive discrimination, and, increasingly, federal courts are saying so. On Thursday, the 2nd Circuit Court of Appeals in New York, which considered Ms. Windsor’s case, ruled that DOMA violates the Constitution’s guarantee of equal protection under the law. That followed a similar result from the 1st Circuit, which in May also found the noxious federal law to be inconsistent with this nation’s foundational values.

Gays, lesbians and anyone rightly moved by their struggle should celebrate what has been a banner year for the cause. After centuries of cold discrimination, American attitudes are shifting, and faster than seemed possible only a decade ago. Ms. Windsor’s success is only the latest sign. Recent polls indicate that a majority of Americans, albeit a slim one, now favors same-sex marriage. Four states including Maryland will hold referendums next month on permitting same-sex marriage; polls suggest that proponents have a shot. For the first time, a sitting president has said he favors same-sex marriage, the same president who eliminated the military’s “don’t ask, don’t tell” policy last year. Now the courts are moving, too.

Still, what role judges should play in this great thaw is a tricky question. Despite the movement in polls, nearly half the country still opposes same-sex marriage. In 32 states gay-rights advocates have lost at the ballot box, most recently in North Carolina in May. And it’s facile to attribute these headwinds to bigotry — unless President Obama was a rank bigot until five months ago. There is natural resistance to changing traditional institutions that provide structure and meaning to so many lives.

Federal courts have so far handed down rulings that make incremental rather than sweeping progress toward enshrining equality for gay Americans as a constitutional guarantee. Though they both repudiated DOMA, the 1st and 2nd Circuits also insisted that their words could not be interpreted to invalidate the will of states that refuse to acknowledge gay commitments. Judicial precedent limited how far these courts could go. But surely so did a cautious calculation that same-sex equality will ultimately be more durable if it is not seen as an imposition on an unwilling public by an unelected judiciary.

If the Supreme Court considers Ms. Windsor’s case on appeal, and the justices are swayed in her favor, they, too, will have to decide: incremental or sweeping.