Artists' music being used in commercials was once a touchy subject. And it is still is, but to a lesser degree nowadays than in bygone decades, it seems. It also depends on what context the music is used and what exact song by which artist is being utilized. Some commercially popular music is just geared to be a jingle. But traditionally the typical "serious" artist felt lending their art in exchange for cash as the soundtrack to some shallow TV commercial geared to sell (the word "pimp" would often be used) cars or washing detergent was the ultimate sellling of your soul to "the man."
And of course, if said artist's music is reactionary, revolutionary, anti-authoritarian, protest type music, it really is contradictory to have it included in a cheesy TV ad -- hence the reason Jello Biafra fought so hard against his litigating former friends/bandmates who he insisted were trying hard to make a quick buck by selling the rights of the Dead Kennedys' song "Holiday In Cambodia" to be used in a Levi's commercial.
But even less politically overt artists than Biafra are against their music being used in commericals. Still, there are exceptions to every rule. A good example is Jack White, who has long been opposed to the White Stripes' music being sold for use in a commercial. Reportedly over the years he and his bandmate have been approached many times and turned down the offers to use the Stripes' music in commercials. But he wasn't opposed to composing a whole new song for a TV commercial a few years ago; he penned the sixties Brit psychedelic inflected tune called "Love Is The Truth" (reminiscent of the Small Faces' hit "Itchycoo Park") with the repeated lyrics "Love is the truth/ It's the right thing to do," to be used in a Coca Cola ad.
Not only was it a good song, but the combination seemed to fit in many ways, including the similarity in the red and white and black color schemes shared by Coke and the Stripes, plus the fact that White is supposedly a big fan of the soft drink, once telling a reporter that he would often have a six-pack of Coca Cola with him in the studio during sessions. Not only that, but the TV ad's film style is somewhat similar to that used in the White Stripes' video for "The Hardest Button to Button" (see below to draw your own comparisons).
On the subject of Coca Cola TV commercials with original music that people really like, back in 1971 the soft drink giant commissioned the song "I'd like to buy the world a Coke" with the repeated phrase "It's the real thing" that was so popular as a TV spot that both the Hilltop Singers and the New Seekers adapted it, changing the lyrics to "I'd Like to Teach the World to Sing (In Perfect Harmony)" and scored pop hits with the former TV ad. Dreamed up by an advertising executive named Bill Backer at the McCann-Erickson agency, who repped Coca-Cola, the song was penned by Backer, who wrote the line "I'd like to buy the world a Coke" and had British hit songwriters Cook and Roger Greenaway come up with the melody which was reportedly based on a jingle by Cook and Greenway, originally called "Mom, True Love and Apple Pie." But even though the New Seekers and the Hilltop Singers dropped the Coke lyrics, subliminally it was still essentially a free promotion for Coca Cola. Below is the Coke ad and the New Seekers' version.