(CNN) Alabama's high-stakes Senate election Tuesday perfectly encapsulates how the age of Donald Trump has turned political logic on its head: Republicans may lose by winning and Democrats can win by losing.

Republican Roy Moore denies accusations of child molestation, but he's riding the President's endorsement. He's trying to win a seat in a chamber where GOP leaders brand him unfit to serve and fear he could eviscerate their party's brand.

The election has far wider implications than the fate of Moore, an icon among evangelical conservatives in the Deep South. The race encapsulates many of the forces convulsing American politics after the tumultuous first year of the Trump presidency and became a testing ground of mobilizing strategies ahead of the midterm elections in 2018.

It has showcased the civil war raging in the Republican Party, between the outsider, populist and almost nihilistic forces represented by Trump and his former political guru Steve Bannon -- who has campaigned for Moore -- and the more pragmatic, futuristic wings of the party. Trump, with characteristic frankness, is openly saying that he backed Moore because he would be far more favorable to his agenda than a Democrat.

"We can't have a Pelosi/Schumer Liberal Democrat, Jones, in that important Alabama Senate seat. Need your vote to Make America Great Again! Jones will always vote against what we must do for our Country," Trump tweeted this weekend.

But in a stunning encapsulation of the Republican dilemma, Alabama's senior Sen. Richard Shelby admitted on CNN's "State of the Union" on Sunday: "I couldn't vote for Roy Moore."

A Jones victory would trim the GOP's Senate majority to only one seat, and improve his party's chances of an upset seizure of the chamber in 2018. But Democrats are in a "heads I win, tails you lose situation."

That's because having purged their own ranks of lawmakers like Sen. Al Franken and Rep. John Conyers who are facing allegations of sexual misconduct, they can make Moore the poster boy for the Republican party they argue has ditched ethics and morality in the pursuit of power.

That has left an opening for Democrats to argue that the GOP's moral authority is fractured and that the party would turn a blind eye to anything -- even the sexual harassment of minors -- in a quest for power.

"What does the Republican Party stand for?" asked Bakari Sellers, a former Democratic nominee for lieutenant governor in South Carolina and CNN commentator, spelling out the Democratic strategy on "State of the Union."

"Even more specifically," Sellers said, "what do white evangelicals in the south and probably throughout this country stand for that you can turn a blind eye to someone who's charged credibly with pedophilia, charged credibly with preying on children that you say, 'oh my God, I'd rather have votes for a tax cut than somebody who is actually a good person?'"

Moore is accused by several women of pursuing sexual relationships with them when they were teenagers, molesting a 14-year-old and sexually assaulting a 16-year-old when he was in his 30s. He has repeatedly denied the allegations.

JUST WATCHED How Moore mastered Trump's anti-media playbook Replay More Videos ... MUST WATCH How Moore mastered Trump's anti-media playbook 02:21

GOP civil war

Moore's GOP enemies fear that the allegations of sexual impropriety — not to mention a controversial record of radical views on issues like homosexuality, immigration, race and Islam could make it far more difficult to appeal to the younger, more diverse America that is emerging as demographics change.

Democrats are likely to highlight the moral questions posed by candidates like Moore in moderate, swing suburbs of cities like Denver and Philadelphia that will play an important role in determining future national elections.

Colorado Republican Sen. Cory Gardner , who is running his party's Senate campaign this year, said last month that if Moore wins on Tuesday, the Senate should vote to expel him because he "does not meet the ethical and moral requirements of the United States Senate."

But ousting Moore, once he has the endorsement of Alabama voters, could intensify the fierce internecine battle threatening to tear the GOP apart. But if Republicans leave him in place, they are offering a gift to Democrats.

The prospect of a Moore win is also a nightmare for Senate Majority Leader Mitch McConnell, who is already struggling to keep his party afloat to pass Trump's agenda and would hardly welcome another boiling controversy.

Moore's campaign has also emerged as a critical test of the political sway of the President -- after Trump went all-in on the race.

Trump's embrace of the Alabama judge suggested that there is little he would not do in the name of power -- and that the party's future reputation is far less important to him than maintaining the Senate majority in the here and now.

JUST WATCHED Trump's evolution on Roy Moore Replay More Videos ... MUST WATCH Trump's evolution on Roy Moore 00:57

Trump may also see kinship with Moore because he is facing his own allegations of sexual harassment against multiple women, which flared up during last year's presidential campaign and which he has denied.

But he's also taking a risk by linking his fortunes so close to those of Moore, especially after holding what was, in effect, a rally for the judge just across the Alabama state line on Friday night in Florida.

If Moore wins, Trump will have made a point that he, and not McConnell, is most in touch with the Republican grassroots. He can also claim ownership of a new political message that may prove powerful among GOP midterm election voters that he pioneered to paper over Moore's liabilities.

"Democrats in Congress want open borders, higher taxes, and government-run health care that doesn't work. Costs a fortune, doesn't work," Trump said in Pensacola, Florida, laying out a coherent rationale for Republican voters to stick with him despite his low approval ratings and volcanic presidency. "They are soft on crime. And they want to suffocate our economy with socialist-style regulation. Raise your taxes through the sky, they don't want to vote for our tax cuts because they want the -- they want tax increases."

A Moore victory would embolden Trump, as well as Bannon, as they seek primary candidates in the President's outsider image to challenge establishment GOP favorites next year.

But if Moore stumbles, Trump will have raised doubts about the wisdom of his endorsement and of his own political heft ahead of the midterms, since establishment leaders like McConnell and Gardner opposed their party's Alabama Senate candidate on the grounds that he was exactly the kind of Republican nominee who could put the party's Senate majority at risk.

JUST WATCHED Flake writes check to Democrat opposing Moore Replay More Videos ... MUST WATCH Flake writes check to Democrat opposing Moore 01:19

Democrats can't lose

Given the agonizing consequences of having Moore in Washington, it's not surprising that there is one school of thought that Democrats would be better off with him in the Senate than with one of their own.

Seeing the GOP twisting itself in knots over the Moore sexual harassment allegations comes at a unique societal moment, one when justice is beckoning for many women, and is a perfect opportunity for Democrats.

Few big party hitters have traveled down to Alabama to campaign for Jones -- though it's possible that could be as much about not scaring off mainstream Republicans who deserted Moore as a lukewarm assessment of his chances in a state where the GOP has a stranglehold on power.

But with GOP leaders suggesting that the reform of welfare, Medicaid and Medicare are up next after tax reform, there is also a good case that Democrats would be better off with Jones halving McConnell's majority.

It's also possible Democrats overestimate the potency of Moore in the run-up to the midterms in November since the election is certain to be predominantly a referendum on Trump and his turbulent, polarizing presidency. If that is the case, having Jones in the seat could take the party one step closer to grabbing back Senate control, a prospect that has long looked impossible but that may now be slightly less of an ultra-long shot given the retirements of Arizona Sen. Jeff Flake and Tennessee's Bob Corker -- both vehement Trump critics.

The spectacle of Moore arriving in the US Senate, alongside Republicans who spurned him and women senators of both parties, could also have an electrifying impact of the #MeToo movement.

The debate over the allegations against him might also again highlight Trump's vulnerability in the area, given the "Access Hollywood" tape in which he was heard boasting about assaulting women.

After all, Franken said in his resignation speech Thursday , it was odd he was leaving and Moore and Trump will not.