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
The Duchess of Cambridge was beaming on the steps of the Lindo Wing hours after giving birth. Mums are also revealing how they looked.
Everyone has their heads down and their eyes averted but I know they can sense my presence.
The pilot left the door to the cabin open as passengers left the plane so they could see for the damage for themselves.