Last night the people of Alabama succeeded narrowly in doing the right thing by rejecting an accused serial sex predator who believes that the Bible should supersede American laws and dispatching his Democratic opponent, a decent man who once prosecuted KKK bombers, onward to the United States Senate. By rejecting Roy Moore, one of the worst human beings ever to run for public office in the history of this country, Alabamians decisively humiliated the hapless, reeling President Trump and his hate-addled former adviser Stephen Bannon, both of whom were all-in for their Gulf Coast Crackpot.

There is no spinning such a shocking, epic disaster for Republicans. By sticking with Roy Moore as their standard bearer in this election long after any sensible group of parents would have removed him from the PTA or thrown him out of the pool party, Republican primary voters and their cowardly, politically suicidal leaders may ultimately cost their party control of the Senate for the second time in six years. With their endless arrogance and inexplicable resentment, they threw away one of the safest Senate seats in the history of the American republic. Democrats now need just to protect their incumbents and make relatively easy pickups in Arizona and Nevada to bring the entire Trump presidency, including judicial appointments, to a halt next November. Full stop.

How did this happen?

Alabama Republicans and their Vichy handmaidens in Congress had every opportunity to get away from Moore long before he tossed away a Senate seat in a state where Democrats haven't won a federal election since 1992. The Alabama state GOP could have cast him aside and encouraged a write-in candidacy for Moore's vanquished primary adversary Luther Strange, or really any sentient breathing member of the state party. The president could have shown courage and decency for the first time in his adult life by declining to endorse Moore or even encouraging Alabamans to cast a ballot for Jones. And Moore himself should have withdrawn from the race once it became clear he was jeopardizing a Republican Senate majority that looked foolproof for 2018 as recently as this summer.

But that is not what any of them did. Because when these Republicans sidle on up to the corner of Right Thing Way and Shameful Capitulation Road, they choose capitulation. Every. Single. Time. The president hesitated, but threw his weight behind Moore earlier this month. With few exceptions, congressional Republicans either endorsed Moore or retreated into a pitiful silence. Collectively, they realized their candidate was an unapologetic accused child predator and a lawless authoritarian and they all climbed on board the Scumbag Hindenburg with him anyway, shouting slurs and outrages right up until the glorious moment last night when their ship burst into flames on national TV. They'll live for the rest of their lives with the rotting moral stench of having supported Roy Moore.

In the long run, that might be best for the GOP. Moore is a man who has said and done so many appalling, indecent, anti-democratic things that it's actually hard to keep track of his outrage litany. He infamously argued in print that Muslims should not be allowed to serve in the United States Congress, in an essay whose grotesquery deserves wider revulsion. Just last week he noted that America was great during slavery. "Our families were strong," he said. "Our country had a direction." In 2011 he co-authored a Bible-themed government course in which one of the modules argued women shouldn't be allowed to hold public office and insisted that it should be illegal to be gay.

For the Republican primary voters of Alabama, none of this mind-blowing lunacy, most of which was known long before this year, was enough to stop Moore. It wasn't until multiple women came forward with allegations that he had been a total creepster in his 30s — allegedly molesting a 14-year-old girl and routinely treating high schools like a 1970s version of Tinder even though he was a grown man and a deputy district attorney — that Moore started to lose ballast in the race. In the end, his undeniable moral rot cost him a seat in the U.S. Senate.

The loss of that seat is a massive humiliation for the Bannon wing of the party and for President Trump himself, a political catastrophe that imperils not only their detested tax reform bill but also any other initiative they wanted to pass. It happened on the same day that the president made an ugly, sexualized attack on New York Sen. Kirsten Gillibrand, who fired back with dignity and restraint. Her righteous fury is increasingly shared by the American people.

Republicans gambled on the very worst kind of person, for the very worst of reasons, and they got the very worst result. The victory of Doug Jones over his rancid opponent proved that Democrats don't need to sell out their most dedicated supporters or change their identity to win elections, even in territory that seems hostile. They just need to fight like they did last night, when Roy Moore's hatred lost out, at least for a moment, to decency and higher purpose.

Any remaining Republicans in Congress who believe in such values should be wondering how, exactly, they might avoid the same fate.