So let us name them and shame them, these dangerous, complacent, self-righteous, wishy-washy liberals who threaten our national security, our vital national interests, and the personal safety of our citizens. Here are the guilty men: Lord Judge, the lord chief justice of England and Wales; Lord Neuberger, the master of the rolls; Sir Anthony May, the president of the Queen's Bench Division; Lord Justice Thomas and Mr Justice Lloyd Jones. Don't they realise there's a war on? Don't they understand that their glib judgments hinder the efforts of the security services to save us from an ever-present threat, imperil our vital intelligence-sharing with the United States, and give comfort to our enemies? Who on earth do these people think they are?

Now let us consider their fearless critics: Kim Howells MP, chairman of the Commons intelligence and security committee, who will hear not a word said against the services he is supposed to scrutinise, and wonders aloud "what the master of the rolls is doing or playing at"; the foreign secretary and the home secretary, whose swords leap from their scabbards to avenge even a look that threatens the secret services with insult; the director general of MI5, Jonathan Evans, who takes the almost unprecedented step of jumping into print to defend his spotless service from such mere "allegations"; Charles Moore of the Daily Telegraph, who attacks "our snug, smug judges" for the way they "undermine" an MI5 officer (witness B), accused of having put verbal pressure on Binyam Mohamed in Pakistan while knowing he had been – and might again be – tortured, "and his service [ie MI5], who take such risks on our behalf"; Nick Cohen of the Observer ("the judges are not alone in their desire for an easy life"); and Bruce Anderson, whose extraordinary defence of torture in the Independent is headlined: "We not only have a right to use torture. We have a duty".

So that's MPs, spies and ­journalists: three groups whose reputation for ­integrity, transparency, fairness and accuracy has, of course, never stood higher with the British public. Who in their right mind could prefer, against the considered, scrupulous and nuanced verdicts of these towering moral ­authorities of our nation, the judgments of mere judges?

Let me be clear. We should never underestimate the terrorist threats we face, and the difficulty of detecting them in advance. There is still too much muddle-headed appeasement of radical Islamists, some of it perpetrated and funded by other parts of the British government. And there is no reason why judges, any more than politicians, spies and journalists, should be above criticism. But, in this case, the criticism of the judges is entirely unwarranted. Far from "undermining", they are upholding what is most vital to the future of Britain: the combination of security and liberty under law. To preserve that, in changed circumstances, requires the most careful balancing acts.

Take, for example, the judgment on appeal earlier this month which allowed the publication of a lower court's earlier brief summary of information from US intelligence sources indicating that Mohamed had been tortured. This begins with the clearest possible acknowledgement from the lord chief justice that "terrorism is a constant threat both here and abroad", and it recognises "the inestimable contribution made to public safety by the longstanding co-operation between the intelligence services of this country and those of the USA", which, it pertinently adds, "is not one-way traffic".

It goes on to describe how the evidence that MI5 knew Mohamed had been tortured was dragged from the claws of secretive governments in London and Washington, and to weigh the balance of risk in releasing what is now already so widely known here and in the US. We still await the court's decision about publishing one paragraph of this recent judgment, apparently suggesting that MI5 deliberately misled Howells' Commons oversight committee on its knowledge of this horrible business; a paragraph which the Master of the Rolls withdrew under government pressure – itself a highly dubious procedure.

Critics accuse these judges, and the NGOs and media organisations that have pressed for openness in this affair – including the Guardian, the Times, the Independent and the BBC, for the journalistic voices I have cited are not representative of the profession as a whole – of a dogmatic "liberal" commitment to broadly defined human rights über alles.

Actually, the way these judges argue is often profoundly conservative. The bedrock, for them, is precedents in English common law and, by extension, in British history. Thus, for example, the recent judgment quotes Queen Elizabeth I's secretary of state, Sir Thomas Smith: "The nature of our nation is free, stoute, haulte prodigall of life and bloud; but contumelie, beatings, servitude and servile torment and punishment it will not abide." The heart of a true British Conservative such as Dominic Grieve, the shadow justice minister, should thrill to this muscular antique prose. Only the neoconservative, that is, the illiberal radical, will spit gall at the taste of such old English spirit.

Even when the final court judgment has been delivered in this convoluted sequence, important questions will remain about the conduct of Britain's secret services in the more than seven years of George W Bush's "war on terror". Making a fresh start after the election, our new government should put the boot on the other foot. Instead of the head of MI5 laying down the law to the judges, a judge should be commissioned to investigate the past conduct of MI5 (and MI6). A judicial inquiry, for which the Lib Dems, the former attorney general Lord Goldsmith, and the former Conservative home secretary David Davis have already called, would have all the advantages that come with a first-rate judge: independent, rigorous, fair, responsible and discreet.

Equipped with sufficient tools for investigation, and the licence to use them, he or she should look into detailed issues raised by the Mohamed case but also broader ones. What, at each stage, were the secret services' rules about torture, about passing on to the US questions for those they suspected were being tortured, and about using information thus obtained? Who, beside "witness B", knew what when? How about his superiors, including Evans himself, then head of international counter-terrorism? What requests for policy guidance, if any, were passed to the Home Office, Foreign Office and 10 Downing Street, and what formal or informal green, amber or red lights flashed back? The court says the value of intelligence-sharing with the US is "inestimable", but perhaps it is estimateable? Might the inquiring judge be given, in strictest confidence, some specific examples of how it had concretely helped to make us safer? Why did the Commons' committee not learn what it should have in a timely fashion? What lessons can be learned for the future?

The object of all this is not to have us ruled by judges. Quite the reverse. It is to create the proper mechanisms of efficient, accountable, law-abiding government, even in the secret services in testing times, and of democratic oversight by a British parliament again worthy of that name, so that no one will need to have recourse to the courts. Meanwhile, thank God – or more accurately, thank history – that we still have such judges.