I don't agree with any artist who promotes an unhealthy lifestyle. But I have a high opinion of Michael Jackson especially, and I think that the Pepsi deal was a mistake for the reasons I've given.
The Beatles had drug songs though. So did solo Paul McCartney with
Let Me Roll It. There's even a bootleg where John Lennon offered Stevie Wonder (who didn't do drugs) some cocaine. Drugs like LSD are pretty much what inspired 1960s psychedelic rock & stoner rock. Many blues & country songs are about getting drunk. In the late 1970s & early 1980s several R&B artists did commercials for Schlitz Malt Liquor including the Commodores when Lionel Richie was still a member.
Paul McCartney owns Buddy Holly songs & showtunes and he approved some to be used in commercials. It was Paul who told Mike about buying song publishing in the first place, because Paul already owned some. Paul himself did an ad for VISA credit card and a brokerage firm too. Ringo Starr also disagreed with
Revolution for Nike, but he did commercials for things like Pizza Hut. I think they just disagreed about that particular song being used, not musicians doing commercials in general.
Revolution had to be approved by their record label since it was The Beatles actual recording and not jingle session singers doing a cover like other Beatles songs used in commercial ads. Yoko Ono had no problem with it, she runs Lennon's estate. She did have a problem when Paul suggested that their song credits should be changed to McCartney/Lennon instead of the order it has mostly always went. And nothing happened with that.
Michael Jackson had videos where he's shooting people in a speakeasy (
Smooth Criminal) and another where he's in a gang (
Bad). Which was before gangsta rap really became popular. Those videos were broadcast more than the Pepsi commercials. It's the same for the songs that are basically a free ad like the Busta Rhymes song I mentioned above. There's a lot of songs where people are bragging about the fancy car brands they own or designer clothes & jewelry. That's Morris Day's entire image and Bruno Mars copied him on tracks like Uptown Funk. Those were in radio airplay rotation. Some singers & actors started their own alcohol brand. The Rock (aka Dwayne Johnson) is one of them and his audience is largely younger children from his wrestling career.