“But it works.”

That, in three syllables, has been the go-to argument of the last two presidential administrations to justify assaulting civil liberties in the name of rooting out terrorists.

It’s a dubious line of reasoning, proceeding as it does from the implicit assumption that if a thing works, if it achieves the important goal for which it was designed, that trumps all other considerations.

But it’s a false assumption and you don’t have to do much cogitating to find the gaping hole in it. Namely: the question of whether or not a thing works has absolutely nothing to do with whether or not that thing is right.

If, for instance, you wanted to stop mass shootings, legislation outlawing the sale, possession or manufacture of any gun capable of firing more than one bullet without reloading might work. It would also be a terrible idea.

So the government’s logic is flawed. “But it works” cannot be the sole metric by which a thing is judged. Especially when it doesn’t.

Work, that is.

Apologists for the Bush administration argued that allowing torture worked, helping to safeguard this country against terrorist attack. Five years after Bush left office, the truth of that claim is unclear at best and still furiously disputed.

The Obama administration, meantime, is dealing with its own civil-liberties controversy: the NSA’s bulk collection of so-called metadata — the date, time, length and phone numbers of every phone call made by darn near everybody darn near everywhere. It is a massive invasion of privacy and frightening, too, considering the ease with which it could be made to serve totalitarian purposes.

But it works, the president has said.

Actually, it doesn’t.

That’s the finding of a report issued last week by the New America Foundation, a Washington-based nonprofit. In reviewing the cases of 225 individuals recruited by terrorist groups and indicted for terrorism since 9/11, it found bulk data collection played a role less than 2 percent of the time. “Surveillance of American phone metadata,” it says, “has had no discernible impact on preventing acts of terrorism and only the most marginal of impacts on preventing terrorist-related activity, such as fundraising for a terrorist group.”

Government claims that the program has been critical to counterterrorism are, said the study, “overblown and even misleading.” This tracks with the findings of another report, issued last month by a group appointed by the White House itself. It dubbed metadata collection “not essential” to preventing terrorist attacks.

As it happens, President Barack Obama gave a speech last week at the Justice Department in which he addressed metadata collection and other controversial intelligence gathering schemes revealed by fugitive NSA leaker Edward Snowden.

The president offered a series of reforms designed to assuage public concern about omnivorous government spying. Among them: a promise to transition custodianship of the metadata database to a non-governmental third party.

So . you feeling assuaged yet? No? Small wonder.

However you slice, dice or spin it, we are left with that same inconvenient truth: “But it works” is a lousy argument, and “it” doesn’t work. That being the case, what justification remains for the government — or a non-governmental third party — to collect information on who we call, how long we talk and when?

This is what the president should have addressed. Instead, he promises to find a different way to do what hasn’t been useful. Shame on him for that. Shame on us if we are mollified by modifications of a program that shouldn’t exist.

What the government is doing would be highly questionable if it worked. It is indefensible since it does not.