The House vote on an amendment to defund the National Security Agency’s surveillance program was extremely close. Yes, the amendment, sponsored by Michigan Republican Justin Amash, was defeated, 217 to 205, but the razor-thin margin suggests some serious issues on both sides of the aisle and in the White House.

President Obama in Germany President Obama at the Brandenburg Gate in Berlin. (Pablo Martinez Monsivais/Associated Press)

The president has avoided publicly and forcefully defending the NSA program. Until yesterday, the White House made little effort to thwart the Amash amendment, according to House Republican aides with whom I spoke. Moreover, the administration was able to deliver only 83 Democrats; 111 Democrats voted to eviscerate the program against the White House’s wishes. When the president gives the back of the hand to national security, his congressional allies feel free to engage in grossly irresponsible behavior. Numerous ranking committee members, the Democratic caucus chairman, and three Democratic members of the House Intelligence Committee voted to defund NSA. The White House came very close to a humiliating loss, in large part because Obama has signaled to the left that his heart is not in critical anti-terrorism measures.

As for the House, the speaker and other senior Republican leaders, perhaps foolishly, indulged Amash. In letting the congressman who has stabbed leadership in the back countless times run through the House with scissors, leaders risked real damage to national security and to the image of the GOP as the more responsible party on the issue. Sure, the right-wing talks show hosts would holler, but would the GOP conference really revolt if the speaker told Amash to take his amendment and … well, be quiet?

It is also odd that the “Hastert rule” caucus, which demands that nothing comes to the House floor without the support of a “majority of the majority,” would insist the Amash amendment get a vote. The vote was taken; business goes on. Why not then bring an amendment on a path to citizenship, for example, to the floor? (Oh, because it might pass.)

But getting back to national security, It is now become fashionable on both sides of the aisle to take whacks at the military and our intelligence agencies. Over in the Senate, Democrat Kirsten Gillibrand (N.Y.) has teamed up with two of the most destructive and least well-informed Republicans when it comes to national security — Ted Cruz (Tex.) and Rand Paul (Ky.) (who have become canaries in the coal mine of legislative foolishness) — to undermine the military chain of command in sexual assault cases. When Bill Kristol (“beyond where even the Obama administration is willing to go in weakening the military … just media grandstanding, like their last bold intervention in national security policy, when they raised the alarm about the dire threat of drone attacks on Americans sitting in cafes”), liberal Sen. Carl Levin (D-Mich.) and the editors of National Review agree that the measure is reckless and unnecessary, you see how this is not merely Republican hawks vs. dovish Democrats; we’re talking about a breakdown in sane oversight of the military.

There has never been a greater need for sober, conservative leadership on national security. The president neglects or actively undermines (e.g. proposing the defense sequester) military readiness and shrinks from international leadership. The left piles on. The unthinking isolationist right adds their yelps. And pretty soon we come perilously close to losing a majority to support common-sense national defense measures. Ultimately, I think this is a losing gambit with voters who really do want a strong defense. But more important, it is dangerous to the safety and security of America and the West.

Jennifer Rubin writes the Right Turn blog for The Post, offering reported opinion from a conservative perspective.