An Old Bailey judge refused to allow a jury to hear about dozens of “grossly offensive and undoubtedly racist” text messages on the phones of two of the G4S security guards acquitted of killing Jimmy Mubenga because they did not have “any real relevance” to the trial.

One of the three defendants, Terrence Hughes, had 76 racist texts on his phone which abused black Africans, Asians and Muslims and were racist about immigration, but Mr Justice Spencer’s decision meant that they were not put into evidence in the trial that ended on Tuesday

A second defendant, Stuart Tribelnig, 39, also had racist texts on his phone and forwarded them to others, although they were fewer in number. One of the texts received read: “Fuck off and go home you free-loading, benefit grabbing, kid producing, violent, non-English speaking cock suckers and take those hairy faced, sandal wearing, bomb making, goat fucking, smelly rag head bastards with you.”

Spencer said the texts had no bearing on the central issue of “whether the defendants deliberately held Mr Mubenga forward, head down, for a considerable period and whether [they] deliberately ignored his repeated protests that he could not breathe”.

The six-week trial ended on Tuesday with the acquittal of Hughes, Tribelnig and Colin Kaler, who were accused of the manslaughter of the 46-year-old Angolan deportee.

No racist messages were found on Kaler’s phone.

A coroner had previously found that Mubenga died of cardiorespiratory collapse as a result of restraint on a British Airways deportation flight in October 2010.

In legal argument during the trial, which can only now be reported, the prosecution unsuccessfully argued that the jury should know about the texts because they shed light on the guards’ state of mind. But the defence lawyers said they would “release an unpredictable and uncorrectable cloud of prejudices”.

Hughes’s counsel had argued the texts do not prove he is racist and were a small fraction of a mass of offensive “jokes” on his phone “at the expense of almost every imaginable minority”. He said there was no evidence of any ill will towards Mubenga. Tribelnig’s counsel said that only one of his racist texts could be said to be directly relevant to Mubenga as it was the only one referring to black people as opposed to Asians or Muslims and that allowing the jurors to see the texts “amounts to an invitation to speculate about the defendants’ motivation”.

Anti-racism campaigners prepared for a US-style “I can’t breathe” demonstration outside the Home Office in London to protest against “a catalogue of bias and racism” in the Mubenga case. “Like in the US, we are protesting against being killed with impunity by the police, privatised police forces and other agents of the state,” said members of the London-based All African Women’s Group, whose members include people affected by deportations. “We were completely devastated that the G4S guards were found not guilty. But we were not surprised. From watching the trial we already knew ... It stank of racism to us.”

Several passengers on Mubenga’s flight said that shortly before he died they heard him say “I can’t breathe” as he was restrained. These were the same words uttered by Eric Garner, a black New Yorker who died in July after being restrained by police officers in Manhattan, sparking widespread protests and unrest.

Inquest, the pressure group for families of people who die in custody, and the Institute for Race Relations both said the racist texts should not have been withheld from the Old Bailey jury.

“The coroner made it absolutely clear how racist attitudes can impact on how people are treated,” said Frances Webber, vice-chairman of the Institute of Race Relations. “I absolutely understand why the Mubenga family would not just be shocked at the verdict but outraged. I don’t think it can be said they received justice.”

Deborah Coles, co-founder of Inquest, which has been supporting the Mubenga family, said: “There is an issue about whether or not the information about the guards’ racism should have been put before the jury and also their anti-immigrant texts. We are talking about agents of the state here with exceptional powers to restrain. I think it should have been put before the jury.”

The evidence of racism by two of the men was contained in a report by Karon Monaghan QC into the death of Mubenga, which reached a verdict of unlawful killing. The coroner said: “There was enough evidence to cause real concern, particularly at the possibility that such racism might find reflection in race-based antipathy towards detainees and deportees and that in turn might manifest itself in inappropriate treatment of them.” Her report and the inquest verdict were withheld from the jury on the orders of the judge.

In a joint statement after Tuesday’s verdict the three guards said they “bitterly regret the death of Mr Mubenga, but have always said they were trying to do a very difficult job in difficult circumstances to the best of their ability”.

The guards said in court that they had not heard Mubenga say he could not breathe and had not pushed his head down and forward towards his knees in a position known to risk asphyxia.

They said they had been restraining him to stop him hurting himself or other passengers on the plane.