There is the old line that fascism spreads because fascists inevitably compel others to become fascists. That is, the aggression of fascism forces an aggressive response, buttressing the fascists' dreams of instilling worldwide aggression.
Well, there is thankfully a counter truth: Music, being non-material, can draw those who love music toward the realization that happiness is non-material.
This lesson is embodied by the creation of this song.
Bobby McFerrin was not the sage who devised the line, "Don't worry, be happy." The man who did was Meher Baba, one of the prominent spiritual leaders of the early 20th century. He was an Indian national who, among many other things, traveled the world teaching his philosophies, advised Ghandi (unsuccessfully) to give up politics, and took a famous vow of silence at the age of 31 that he adhered to until his dying day.
Instead of dreaming up that line, what happened was: McFerrin found himself in some friends' apartment in San Francisco, noticing a poster on the wall with Meher Baba on it and that famous phrase. He thought it was "a pretty neat philosophy in four words," and off went his mind into a melody brought on by this exposure.
The musical mindset he had and the predisposition to admiring the simple truth (and musicality) of that phrase are not accidentally related. When you love music, when you live especially to produce music, the aggressiveness and conceit erupting from the pursuit of the material tends to seem alien. When you're Bobby McFerrin, freak virtuoso vocalist capable of creating entire compositions with nothing but the sound of the voice you were born with, the material trappings of the world have to seem very non-essential to the equation of life satisfaction. He didn't even have to save up for some dreamy white Stratocaster before he could renounce materialism in the pursuit of the great intangibles of harmonic sound.
In short, Bobby McFerrin didn't recite "Don't worry, be happy" necessarily as a life credo. He just found the phrase stylistically compelling for use in a song. So he wrote the song. It uses this phrase as its refrain, because that was the fun formal possibility this songwriter saw in that phrase.
And from that germ of an idea, more ideas sprouted and grew. During breakfasts and naps and walks and showers, the song created itself in his head: The sweet happy little theme that introduces the song and reappears in the choruses; the rich harmonies; the reggae rhythms; the development of the lyrics to compliment Meher Baba's phrase, as well as their gentle style of delivery.
Bobby McFerrin would have never just coined a phrase like "Don't worry, be happy" on his own. But his musical passion led him down a road in life that helped him exemplify that phrase, to the point of literalness. You could take it all away from him tomorrow; he would still have his voice and this tune.