An extraordinary spectacle is being played out with the head of MI5 denouncing the media – and implicitly three of the country's most senior judges – for reporting that officers in the security service were complicit in "at the very least cruel, inhuman and degrading treatment" of Binyam ­Mohamed, a British resident, by the CIA.

The MI5 boss, Jonathan Evans, in an article in today's Daily Telegraph, referred to "conspiracy theory and caricature", and to allegations that his organisation has been trying to "cover up" its activities. "That is the opposite of the truth," he wrote. It stems from an attempt, so far successful, by the government's counsel, Jonathan Sumption QC, to suppress damning criticism of MI5 in the draft judgment of Master of the Rolls Lord Neuberger, endorsed by three appeal court judges in the Binyam Mohamed case.

In a letter to Neuberger, Sumption complained that the draft suggests MI5 officers "deliberately misled" parliament's Intelligence and Security Committee, the ISC, shared a "culture of suppression" and "does not in fact operate a culture that respects human rights". In what Neuberger admits was an "over hasty" response he immediately cut the offending paragraph, a move being challenged by lawyers for Mohamed, Liberty, Justice, Index on Censorship, the Guardian, the Times, the BBC, and other media.

The criticism of MI5 – to which Evans and the home secretary, Alan Johnson, responded in remarkably intemperate language today – came not from the media, as they suggest, but from a senior judge, supported by two others. It is based on evidence, including 42 unpublished CIA documents, collected over the past 18 months by two high court judges and described in six separate judgments.

Their judgments are strongly critical of David Miliband, the foreign secretary. They show how MI5 withheld evidence from the ISC, contrary to claims made by its chairman, former foreign office minister,, Kim Howells. "We can ask for absolutely any classified material we want to see and we do it all the time," Howells said. The trouble is he does not know what to ask for.

It was clear from the evidence "that the relationship of the UK government to the US authorities in connection with Mohamed was far beyond that of a bystander or witness to the alleged wrongdoing", the high court judges said. Only last summer, well over a year after the hearings began, did MI5 officers provide fresh evidence revealing the extent to which MI5 co-operated with the CIA in Mohamed's interrogations, including sending a list of 70 questions he should be asked, while the CIA passed back Mohamed's answers.

Evans expressed the hope in his article that the US will not now be "less ready" to share vital intelligence with Britain. The same concerns, repeatedly expressed by Miliband during the hearings, were dismissed by the appeal court as "logically incoherent and therefore irrational". While the political and security establishment hits out at the British judiciary and media over revealing sensitive information, the facts of the case were laid out already in a US court that accepted as true detailed allegations of Mohamed being "physically and psychologically tortured". The US judge added: "His genitals were mutilated. He was deprived of sleep and food."

Rather than focusing on accusations of cover-ups, Evans and MI5 should address the more profound failings. Evans' argument suggests that the media reporting the findings of senior judges is dangerous, helping our enemies use "propaganda" to undermine our ability to confront them. Better to remember the government's more traditional argument: it is the failure to uphold our values, and the law, that is the greatest propaganda own-goal.