Corporal Donald Payne, one of the defendants, had pleaded guilty to the charge of inhumanely treating the Iraqi civilians, making him the first British soldier to plead guilty to a war crime under international law.
But McKinnon ruled that two other charges against Payne - manslaughter and perverting the course of justice - should be dismissed.
The court was told that Baha Mousa, a 26-year-old Iraqi hotel worker, died after Payne tried to restrain him by kneeling on his back.
McKinnon also dismissed the charges of inhumanely treating detainees against Lance Cpl Wayne Ashley Crowcroft, 22, and Pvt Darren Trevor Fallon, 23, as well as a common assault charge against Sgt Kelvin Lee Stacey, 29, and a charge of negligently performing duties against Col Jorge Emmanuel Mendonca, 42.
The prosecution alleged that Mendonca, a former commander of the Queen's Lancashire Regiment and the highest-ranking British serviceman to face a court martial in recent history, had failed to ensure that the detainees were treated properly.
The judge said in his ruling that the prosecution did not have the evidence it needed to convict Payne, Ashley, Fallon, Stacey and Mendonca.
One reason was that the hooded Iraqi civilians were unable to identify the soldiers who had allegedly mistreated or beat them.
McKinnon also described as unreliable the testimony of one British soldier who had acted as a prosecution witness.
Julian Bevan, acting for the prosecution, told the court that the defendants suspected the Iraqi detainees had been involved in the slaying of six British military police officers in August 2003 and the death of a soldier in a bombing on a military ambulance in Basra.
Ahmad Taha Musa al-Matairi, the only detainee to testify at the court-martial, said the defendants laughed as they beat one of the detainees and took bets on which soldier could knock him down first.
McKinnon said the court-martial at the Bulford Camp army base in the UK, would continue against Warrant Officer Mark Lester Davies, 37, and Maj Michael Edwin Peebles, 35, on the charge of negligently performing their duties.