Why you were dreaming about sad song
During your previous day, did some event or input make you feel sad? Did you hear a sad song and the lyrics remained in your head? One of these stimulus may have triggered the memory of the song, to be replayed in your dream. So you dreamed of the sad song.
Sometimes, the input stimulus a couple of hours before bedtime, remains fresh in your memory. When you fall asleep, this recent memory is replayed in a dream.