Why do people associate certain music with sadness?
People will associate anything with anything, not just music. The mind just connects things.
Music is highly emotional. In the West, music is divided in major and minor keys. Musical expression of the minor third is the one which seems to connect with the human emotion of sadness the most strongly. Major key music conveys a happier, positive emotion.
Music is used in ads for multiple reasons. One reason is that the makers of the product or service want you to associate a certain song (say, a popular one) with their product, or they might want you to associate the feelings (such as happiness, positivity, nostalgia) that the song invokes with what they are selling and hope that you will buy the product or service based on how the song makes you feel.
People can communicate in writing (sending letters, or notes, or texts and e-mails). They can communicate by telephone. They can communicate through giving a speech or a presentation. They can communicate through music (many songs express certain emotions, like love or hope or sadness or desire). And they can communicate by using the mass media-- radio, television, movies, the internet, recorded music, books, magazines, and newspapers.