Mr Ahmad has been held without trial for more than seven years while he fights extradition to the US.
He strongly denies any involvement with terrorism.
Mr Ahmad is being held in a special detainee unit at Long Lartin Prison, Worcestershire, waiting for the European Court of Human Rights to rule on whether he should be extradited.
The BBC had applied for permission to conduct a face-to-face interview with the prisoner.
Judges were told the Ministry of Justice had initially granted permission for a meeting at Long Lartin but then withdrew the offer after the corporation argued the interview should be filmed.
Mr Clarke’s lawyers argued that the government’s general policy of refusing permission for prisoners to give live interviews is a “necessary and legitimate” interference with prisoner’s rights.
But at the High Court today Lord Justice Hooper and Mr Justice Singh found that the case was “highly exceptional.”
Because of its unusual facts Mr Clarke’s continued refusal to allow the interview was a “disproportionate interference with freedom of expression” and must be quashed, they said.
Government lawyers indicated there would be no appeal and talks will take place about the practicalities of arranging an interview.
Mr Ahmad’s lawyer Simon Creighton of Bhatt Murphy solicitors, who represented his client as an interested party in the proceedings, said: “My client is delighted that the court has recognised the right of freedom of speech also encompasses the right of the general public to be properly informed.
“Mr Ahmad has not been charged with any crime in this country but has spent the best part of a decade in prison. There is simply no justification for preventing the BBC from speaking to him about his experiences.”
A Ministry of Justice spokeswoman said: “The court was clear that this is a highly exceptional case. It upheld the general policy, and explicitly stated that ‘we do not consider that the present case should be regarded as setting any precedent for other cases.’
“The Justice Secretary accepts the judgment of the High Court and does not intend to appeal the decision.”