Spin bowler Warne's appearance in the Advanced Hair Studio advert was seen as celebrity endorsement of a treatment which uses medicine, the Advertising Standards Authority (ASA) said.
The Hampshire captain's image appeared beneath a headline reading: "Advanced Hair, Yeah, Yeah!", followed by the phrase: "Warnie, Warnie, Warnie."
The 36-year-old was quoted as saying: "I've been hearing it for years but to me I've always taken it as a warning.
"And that warning was that if I didn't do something about my hair loss they may well have been chanting baldy!"
The advert referred to a treatment called advanced laser therapy which uses a medicine called minoxidil.
After probing complaints about the campaign, the standards watchdog said: "We concluded that the ad breached the code over the use of a celebrity endorsement for a treatment that involved medicine."
It warned Advanced Hair Studio not to mention the laser treatment in future campaigns using Warne.
The studio, however, said Warne's comments endorsed its services in general and did not specifically refer to the laser treatment.
Advanced Hair Studio said it would "robustly appeal" against the ruling.
Founder and managing director Carl Howell said: "In our adverts, cricket legend Shane Warne promotes our company rather than any particular treatment."
Separately, the advertising standards body ruled that a "So where the bloody hell are you?" campaign by the Australian Tourist Board was a light-hearted play on Aussie informality and did not breach the code on decency.
The ASA had received complaints that the phrase was offensive and inappropriate.