Regardless of how the Supreme Court rules on the two big gay marriage cases it heard last week, it’s only a matter of time before the institution is legalized. Public acceptance is accelerating and will soon be overwhelming. Red-state Democrats are endorsing gay marriage by the day, and the Senate recently got its first and second Republican supporters. Even conservatives bitterly opposed to gay marriage concede the cause is hopeless. “I don’t care what the Supreme Court does,” the famed marriage enthusiast Rush Limbaugh bleated last week. “This is inevitable.” All of which makes you wonder: In this day and age, who would bother not simply condemning gay marriage, but funding the legal opposition of it?

And then you remember: Oh yeah, House Republicans would. It turns out that in 2011, when the Obama administration stopped defending the Defense of Marriage Act in court, the House Republicans pitched in millions of taxpayer money to ensure that the law would continue to bar gay spouses from receiving the same federal benefits that heterosexual spouses enjoy.

Suffice it to say, gay marriage is hardly the only issue on which House Republicans have managed to position themselves on the dicey side of public opinion. Their insistence on letting the government default on its debt unless the president accepted trillions in Medicare and Medicaid cuts drove their approval ratings to subterranean depths in the summer of 2011. Their refusal to deliver on $60 billion in aid for Hurricane Sandy victims earlier this year drew a rebuke from Chris Christie, one of the GOP’s biggest celebrities. Recently, as immigration reform has moved to the center of the Washington conversation, they’ve demonstrated their sympathy for the little guy by employing such terms of endearment as “wetbacks” while alternately describing immigrants as dogs, livestock, and terrorists. (Okay, those last three all came from Iowa Republican Steve King. Still…)

What explains the PR pileup that GOP elders can't seem to clear to the side of the road? Partly it’s the structural forces at work in American politics, which have reorganized the two parties along ideological lines at the same time the GOP has become much more conservative. But the more direct and mundane explanation is gerrymandering. Thanks to the way Republican legislatures drew congressional districts in 2000, the median House district leaned Republican by two points over the next decade—a big edge given the tiny margins that frequently decide competitive races. Since 2010, the built-in advantage has grown to three points. The result of all this gerrymandering is to give the Republicans a death grip on the House. In 2012, they won 1.4 million fewer votes than Democrats in all the House districts combined, but still managed a 33-seat majority.

There’s no question this hold on the House is a huge short-term advantage for the GOP, giving it the power to thwart a Democratic president even when his agenda has widespread support. (Look no further than the ongoing budget negotiations, in which the president’s preference for trimming the deficit through spending cuts and tax increases far outpolls the GOP’s cuts-only approach.) But the flip side of being so insulated from public opinion is, well, being so insulated from public opinion. Thanks to the relative safety of their seats, most Republican House members feel no particular need to adjust to the political trends that have enormous consequences for anyone who isn’t running in a gerrymandered district—like, say, the party’s presidential nominee. It’s killing the GOP nationally.