If you had told me 18 months ago that Donald Trump would end up as the Republican nominee for president in 2016, I would have called you crazy. If you had then followed up by saying that his candidacy would receive enthusiastic support from evangelical Protestants, I would have called you a fool.

But the crazy fool would have been right.

The evangelical embrace of Trump (after considerable early skepticism about his bid for the White House) is remarkable for several reasons. It indicates that evangelicals are considerably less concerned about the personal moral and religious character of presidential candidates than many (including, I suspect, many evangelicals themselves) have typically presumed. It also demonstrates that social conservatives are more willing than members of the Republican Party's other two major factions — pro-business economic libertarians and hawkish foreign policy internationalists — to embrace a brash, populist insurgent. Many members of the first group have remained on the sidelines and some appear willing to entertain defecting to Libertarian Party ticket of Gary Johnson and William Weld; members of the second, meanwhile, have gravitated to Hillary Clinton.

But not evangelicals.

The question is why. Why would voters who engage in politics in large part because of their attachment to a social-conservative agenda rally around a blustering, bragging vulgarian who's on his third marriage; who specializes in such un-Christ-like behavior as mocking a reporter with a disability; who favors such policies as rounding up and deporting millions, torturing terrorism suspects, banning the members of specific religions from entering the United States, and striking first with nuclear weapons; and perhaps most pertinent of all, who shows no interest in, knowledge of, or sympathy for the social-conservative agenda?

There are, in fact, many reasons.

There's the powerful strand in evangelical culture of thinking about Christianity in terms of the "prosperity gospel" — the view that worldly success is a sign of divine favor. For some steeped in this way of thinking, Trump's apparent success in business could outweigh seemingly obvious evidence of moral faults.

Then there are those who seem willing to believe, in an act of world-historical gullibility, that Trump has recently come to have "a relationship with Christ."

But I'd be willing to bet that for many evangelicals there's something else going on.

The religious right reached the zenith of its influence on the Republican Party and the country as a whole with George W. Bush's re-election in 2004. It's been downhill into disarray ever since. Evangelicals were very much junior partners in the presidential campaigns of John McCain in 2008 and Mitt Romney in 2012. And that was before same-sex marriage prevailed at the Supreme Court in June 2015, dealing a massive blow to social conservatives hoping to reverse gains for gay rights over the previous decade.

Today the religious right's theoconservative agenda of injecting orthodox Judeo-Christianity into the nation's public life has shriveled into an effort to protect devout Christians from being forced by the government to conform with the dictates of anti-discrimination law in all of their dealings with the wider world. Which means that a movement to reclothe the "naked public square" in vestments has become a rear-guard defense of religious freedom.

If you're part of an ambitious, self-confident movement out to transform the country in a traditionalist Christian direction, you want a president like Dubya, who will speak boldly and unapologetically about his faith and how it informs his policy agenda. But if you're feeling defeated and demoralized, weak and vulnerable, you probably want a president who will serve as your protector.

That's what I suspect a fair number of evangelical Trump supporters believe they've found in the Republican nominee.

Oh, I'm sure a fair number are also motivated by hatred of Hillary Clinton — disgust at her character flaws (which some consider, inexplicably, to be worse than Trump's) and her perceived hostility to traditionalist Christians. If she wins in November, the rout of the religious right that began in earnest under Barack Obama will only accelerate, with Clinton appointing secular liberal judges at all levels of the judiciary and using the full power of the administrative state (especially the Justice Department and Department of Health and Human Services) to force conformity to the new politically correct consensus on marriage, sexual preference, and gender.

But evangelical support for Trump isn't just an anti-Clinton reaction. There's a pro-Trump case to be made, and it follows directly from the constriction of social conservative ambition in recent years.

If all evangelicals want, need, and can realistically hope to achieve is protection, Trump can look pretty good. He's a tough guy. A strongman. A fighter who never backs down. And evangelicals think they now have a relationship with him. An understanding. In the primaries, Trump needed them to resist to urge to embrace his rival Ted Cruz, and they came through. He responded by buttering up Seventh-day Adventist Ben Carson for a few weeks (after having first mercilessly and repeatedly attacked him), and by giving a series of speeches to evangelical groups designed to demonstrate his loyalty, and by allowing social conservatives to write various items on their policy wish list into the (non-binding) 2016 Republican platform.

Do many evangelicals believe a Trump presidency will lead to the passage of a constitutional amendment overturning the Obergefell decision declaring same-sex marriage a fundamental right? I doubt it. But what I suspect many of them do believe is that Trump's willingness to allow them to state it as a goal in the platform is an important sign that the Republican nominee is on their side, despite his personal expressions of support for LGBTQ rights, at least when it comes to the truly important (and winnable) battle to protect the religious freedom of conservative Christians.

Does it make sense to believe that Donald Trump would serve as a reliable head of an evangelical protection racket? Not at all. While he does tend to think of human relationships — including relationships among members of military alliances — in blatantly conditional and transactional terms, Trump's extensive track record of business and personal dealings indicate that, even in those terms, he's anything but reliable. On the contrary, he seems to be perfectly willing, and even predisposed, to screw over anyone and everyone the moment he believes it's in his interest to do so.

But desperate times call for desperate measures. A year after same-sex marriage was pronounced a constitutional right, evangelicals are feeling desperate indeed. And Donald Trump is perfectly poised to reap the electoral benefits.