The judge in the Tulisa Contostavlos trial said evidence given by undercover reporter Mazher Mahmood was "entirely inconsistent".
Explaining his decision to throw out the trial, Alistair McCreath said the prosecution's case had become "tainted" by "serious misconduct".
Before the start of the trial, Contostavlos' lawyers had attempted to have the prosecution "stayed", meaning it would have been thrown out before beginning.
The court hear that there was a problem with evidence provided by a driver called Alan Smith, who originally said he had heart Contostavlos speaking disapprovingly about drugs when she was in his car.
He then "changed his mind", after a conversation with Mahmood, the court was told.
At a pre-trial hearing, Mahmood denied having had any conversation with Mr Smith about what Contostavlos had said.
But the judge said when asked about the same topic during the trial, Mahmood gave answers that were "entirely inconsistent".
More top news
Debates are often lively on ITV News, but when two siblings joined Alastair Stewart for a piece on milk allergies, it all turned a bit sour.
An NHS trust declined the £2,500 raised by a group of men dressed up as female nurses saying the costumes were "insulting".
The Three Lions record goalscorer has revealed why he turned down the opportunity to add to his 119 caps and revealed his lasting regret.