From left, House Majority Whip Steve Scalise, R-La., Senate Majority Leader Mitch McConnell, R-Ky., Speaker of the House John Boehner, R-Ohio, and House Majority Leader Kevin McCarthy, R-Calif. (J. Scott Applewhite/AP)

WHATEVER ITS merits or shortcomings, a federal judge’s decision last week blocking the Obama administration’s immigration policy offered congressional Republicans an escape path from the corner into which they had painted themselves by imperiling funding for the Department of Homeland Security and its 240,000 employees. Thus far they have not shown the wisdom to accept this gift.

It’s hard to grasp the logic that would impel GOP lawmakers to suspend funding for the gigantic department when the move that inspired their threat in the first place — President Obama’s executive action shielding millions of illegal immigrants from deportation — has been put on hold. Why not treat the policy issue as moot, which it is for the time being, and keep funds flowing?

The answer, it seems, is that the fervor of Republican partisanship, especially in the House, is immune to logic beyond an insistence on victory at any cost — the cost in this case being the imminent shutdown of a critical chunk of the federal government.

Under a plan devised by House Republicans incensed by Mr. Obama’s immigration stance, funding for DHS will expire Friday unless Democrats and moderate Republicans in the Senate accept poison-pill amendments killing off the policy . There’s zero chance of that happening; still less that Mr. Obama would sign such a bill.

A number of House Republicans have shrugged off the effect of a cutoff of funds, pointing out that 85 percent of the department’s personnel are considered “essential,” meaning they would stay on the job — though without receiving paychecks. Another 30,000 would be furloughed, straining a department already notorious for poor morale. Is that a sensible way to treat the Secret Service, Border Patrol, Coast Guard, Transportation Safety Administration, customs officials and the Federal Emergency Management Agency, to name just some of the department’s parts?

Even with most employees continuing to report to work, the shutdown would have damaging effects. Training programs and federal grants to state and local law enforcement agencies would be immediately curtailed, as would video surveillance of border areas of the Rio Grande Valley, which GOP lawmakers regularly denounce as porous. Funding for the Secret Service, widely regarded as in need of upgrades, would be curtailed, and most workers at FEMA would be sent home.

DHS, a colossus forged mainly at GOP insistence after the Sept. 11, 2001, attacks, combats terrorism, cyberthreats and smuggling, to name just a few of its vital functions. For years it has been one of the government’s least happy workplaces, a problem the department has studied endlessly without much to show for it, as The Post’s Jerry Markon reported. Making it a whipping boy for Republican dyspepsia at Mr. Obama’s immigration policy risks further debilitating the department.

On taking control of both houses of Congress, Republican leaders pledged to avoid further government shutdowns. They then set precisely the opposite course — a course seemingly designed to prove they are incapable of governing.