President Obama’s State of the Union Address was an advertisement for his ideological fixity, and so he reiterated his unbending determination to close down the prison facility at Guantanamo Bay.

Gitmo is to him what Carthage was to Cato the Elder. It is an obsession, and it must not stand.

One of his first acts as president was to sign an executive order to close it down (having no idea what that would entail). If he has to, he will send Marine One to evacuate the last of the detainees as he leaves office in January 2017.

He had in mind what would be his hard-left, foreign-policy legacy long ago, no matter what the prudential considerations or the circumstances. He wanted to “end” the wars in Iraq and Afghanistan. Empty out Gitmo. And forge openings with Cuba and Iran.

Gitmo has never been an ideal arrangement. But it’s hardly a national disgrace, either.

At the inception of the War on Terror, the United States was confronted with a problem: What to do with people we knew to be dangerous but couldn’t readily try in our civilian courts? All these years later, that’s still the crux of the issue.

Obama makes a practical and moral case against the prison. The practical case is, as he said Tuesday night, that terrorists use Gitmo to recruit. At times, he has called the facility “probably the No. 1 recruitment tool that is used by these jihadist organizations.”

That is laughable. The president won’t say that violent extremists are motivated by Islam, but he is certain that they are motivated by Guantanamo Bay. To believe his rhetoric, radical Islam isn’t a threat, but radical opposition to Guantanamo Bay is.

Of course, terrorists don’t lack for justifications for terror. They were attacking us before anyone had thought of Gitmo, and they’ll be attacking us once it is shuttered.

Remember when the Iraq War was the greatest terrorist recruiting tool? Since we’ve gotten out of Iraq, there are probably more terrorists, who are certainly better equipped and hold more territory, than at the height of the war there.

We could curl up in a passive and inoffensive crouch — and that still wouldn’t stop radical Islam from attacking us. Its drive to kill and dominate emanates from the insatiable vortex of a totalitarian ideology.

As for the moral case, the president expressed it in the State of the Union with that preening cliché, “It’s not who we are.”

We aren’t the kind of people who hold enemy combatants during wartime? As a general proposition, this is false and nonsensical, and Gitmo in particular by now is more than a blip.

It has been open since 2002. It still houses more than 100 detainees, and congressional majorities repeatedly have thrown up obstacles to closing it.

If the sin of Gitmo is holding enemy combatants without trial, that is going to happen no matter what.

Even Obama’s own task force to study Gitmo several years ago concluded that, at that time, there were 48 detainees “too dangerous to transfer but not feasible for prosecution.”

If, as the administration prefers, these type of detainees go to Fort Leavenworth, then that prison would merely become the next alleged stain on American honor.

The reason to keep Gitmo open is that we can’t trust other countries to hold the worst of the worst. The recidivism rate of all detainees released from Gitmo so far is roughly 30 percent.

A risk of bringing them here to be jailed is that judges, prone to imposing their policy preferences, will find a way to order their release.

In 2013, Obama called Gitmo “a symbol around the world for an America that flouts the rule of law.”

Maybe it would be less so if the president of the United States didn’t partake of the cheap moral umbrage over it.