The ad appeared as a paid-for message on the dating app Tinder in March. The message read: "Stuck in the friend zone? You won't be for much longer if you use this Cheltenham free bet offer. Join William Hill with code W40 and bet £10 on any Cheltenham race to get 4 X £10 free bets. T&C's apply."
The paid-for message received one complaint, who challenged whether the ad breached the Code by linking gambling to sexual success.
In response, William Hill said the promotion was trying to relate the offer to the business it was advertising on - as Tinder is a dating app, the subject matter of the text reflected that.
It admitted however that, upon reflection, it could see how it would be interpreted differently, but stressed it wasn't its intention to link gambling to sexual success.
As well as removing the ad, William Hill has conducted a full review of existing content on the platform.
Tinder responded to the ban to say it had initially reviewed the ad to ensure its content was not socially irresponsible, offensive or targeting minors and it passed its initial screening.
Although the ad was removed by William Hill, the ASA underlined that the ad breached the CAP code, which requires that marketing communications for gambling must be socially responsible and shouldn't link gambling to seduction, sexual success or enhanced attractiveness.