A Transport for London spokesman said: "The High Court has found that we were right not to run the Core Issues Trust's advertisement as it would have breached Section 149 of the Equality Act 2010.
"The advertisement clearly breached our advertising policy as it contained a controversial message and was likely to cause widespread offence to the public.
"This was borne out by the hugely negative public reaction the advertisement generated, including on social media and newspaper websites.
"We are taking steps to address the judge's comments regarding our internal processes."
More top news
RMT members staged a protest outside Parliament to mark the anniversary of the first strike one year ago today.
The former mayor of Tower Hamlets, was forced to step down after he was found guilty of a string of corrupt and illegal practices.
The service is the first to be held in the singer's honour since the private funeral held by the family at Highgate Cemetery on March 29.