After all the credible allegations against Roy Moore, after his initial, fumbling denials, you would think he’d be down for the count. But no. The polls show a tight race in Alabama, and the political betting markets actually make him a heavy favorite.

Why?

Partly because Alabama is such a deep-red state. And partly because the Democrats’ own sexual scandals have helped Moore. It’s not obvious they would. If the Democrats had condemned their own members promptly and forthrightly, when the evidence against them was compelling, then the party could stand on solid ground condemning Republicans. The cascade of scandals would highlight the seriousness of the problem and give Alabama voters a clear-cut opportunity to rebuke Moore’s alleged predatory behavior and, with it, the atrocious conduct of many others.

That’s not what Democratic congressional leaders did. Instead of standing on moral ground and condemning sexual misconduct, regardless of party, they dug a bunker to protect their own. They adopted a familiar public-relations strategy: look troubled, condemn the general problem, avoid specifics, and call for an inquiry (behind closed doors, of course). No transparency. No public shaming. Most of all, wait and see. Don’t call for one of your own to resign unless the public pressure becomes unbearable.

That’s exactly how Nancy Pelosi responded to multiple, credible allegations of sexual misconduct against senior Michigan Congressman John Conyers. On Sunday, Pelosi went on NBC’s “Meet the Press” and genuflected to Conyers, calling him an “icon.” When she asked, rhetorically, “Who knows these women?” she made clear what really matters to her: partisan advantage.

By Thursday, she finally decided where that advantage lay. She called for Conyers to resign. Why so slow? Because the political choice was between two key Democratic constituencies, compounded by her party’s bedrock commitment to identity politics. Pelosi and other Democratic leaders know they gain with women voters (and many men) by condemning sexual harassment and assault. But they lose with many African-Americans when the accused is a prominent black legislator and the resignation call comes from a white one. That was the choice facing Pelosi. Which alternative would cost them more votes and more donations?

In these awkward circumstances, Nancy moved slowly, watching the allegations and evidence pile up, and watching resentment among women grow. Her best solution would have been for Conyers to resign because the Congressional Black Caucus asked him to. No dice. The CBC talked with him but told reporters they would wait for the Ethics Committee to do its work. That would be complete within the decade.

Of course, Pelosi’s amoral calculation is exactly what politicians and bureaucrats do. TV and movie executives, too. They protect their own, unless the risks are too high or the payoffs too low. Does anybody really think major Democratic donors in Manhattan and Malibu didn’t know what Harvey Weinstein was doing, year after year? They knew, but they wanted his money and prestige more. Did they really think the multiple assault allegations against Bill Clinton were groundless? Of course not, but they wanted to insulate a Democratic president from attack. The Republicans are no less protective, though they seem to boot the losers more quickly.

How does this national scandal affect Roy Moore’s chances in Alabama? Simple: If the issue is Moore’s own behavior, he loses. If the issue is partisan advantage, he wins. His chances are dim if the race is dominated, as it was two weeks ago, by allegations that Moore trolled for teenage girls at the mall. His chances are far better if the race is dominated by partisanship, or, better yet, by “us Alabama Republicans” versus “those national Democrats.” In a deep-red state like Alabama, Moore wins in spite of the allegations if voters come home to their party.

Nancy Pelosi’s defense of John Conyers framed the race exactly the way Moore wants it. Her belated change of heart will not erase the memory: The issue is party, not principle.

With Conyers and Sen. Al Franken still in office, voters don’t have to look hard to see the hypocrisy or the raw, partisan calculus. Pelosi revealed it with her temporizing, the Congressional Black Caucus with its silence. President Trump revealed it with his backhanded defense of Moore. If Alabama voters use the same calculus themselves, the Republican wins. If he does, he should tip that cowboy hat to his accidental wingman, Nancy Pelosi.