We don't live under a police state and the best way to ensure that this continues is by challenging this overstepping of the mark.
Police do not have to have grounds for suspicion to stop people under Schedule 7 of anti-terror legislation, but they are supposed to use their interrogation powers to gather evidence to expose and prevent terrorism.
Miranda says that the full nine-hour session for which he was held - the maximum currently allowed under law - was devoted to questions about his partner Glenn Greenwald's work in analysing data revealed by whistleblower Edward Snowden.
Security authorities in Britain and the US are understandably put out by Snowden's shedding of light on their unlawful surveillance and Greenwald's role in making this more widely known.
But embarrassing the intelligence services does not constitute terrorism or anything like it.
Nor should the spooks be able to take out their frustration at being denied access to Snowden by Russia's decision to grant him political asylum for a year or to Greenwald because he lives in Brazil by putting Miranda through the wringer.
British state security's vindictive treatment of Miranda discredits the anti-terror legislation passed by Parliament.
It is supposed to protect the people of this country, but it is being misused to bully a man whose only crime is to be in a relationship with a journalist prepared to speak truth unto power.
This country's politicians and media would be up in arms if another state had held an innocent British citizen in order to get at their partner indirectly.
And if the government of the state in question denied any knowledge of such outrageous behaviour, asserting that police officers alone had decided to single out the British citizen for such extraordinary treatment, it would have been derided in the most scornful of terms.
No-one will believe for a minute that Cameron's government was not involved in this attempt to fire a shot across Greenwald's bows.
But if the Prime Minster really was kept in the dark, then this is clearly a matter of the intelligence services getting out of control, using draconian powers designed to safeguard the public in order to pursue a private vendetta.
It must be stressed that Greenwald has committed no crime against English law or legal action would have been taken against him and the Guardian where he published his material.
So the intelligence services are not only misusing the law to victimise individuals. They are also threatening media freedom.
Labour MP Tom Watson's pledge to raise the matter when Parliament returns next month to reassert political supervision of our spying agencies should be supported by all MPs.
However, the issue cannot be kept on hold until then. The government must be flushed out over what it knew about the plan to stop Miranda and when.
Cameron is dodging the issue, saying through his spokesman: "It is an operational matter for the police so we are not going to comment any further."
That cannot be the end of the matter. If the government authorised this misuse of state powers, it should admit it.
If not, it has a responsibility to call those who did to book.