Transport for London had been taken to court after it banned posters with the ads, the BBC reported Friday.
The ads read: "Not Gay! Ex-Gay, Post-Gay and Proud. Get over it!"
The court ruled the agency's process for banning the ads was "procedurally unfair" but the the judge said, allowing the ad would cause "grave offense" to gays because it was perceived as homophobic and would increase "the risk of prejudice and homophobic attacks."
The ad was sponsored by the Core Issues Trust in response to a bus poster campaign by the gay rights group Stonewall, which had an ad that read: "Some people are gay. Get over it!"