This “hearing” will be connected with meaning by these organisms (e.g. loud and low frequency = big, strong and dangerous, scratchy noise + potential food). That means there is already (without music) a perceptual link between sound and emotion.
On top of that the natural harmonic series should be universal, which means that other intelligent life forms could derive joy from how sounds fit together harmonically. A certain level of intelligence will inevitably lead organisms to think a lot about the (potentially dangerous) sounds in their environment and given a certain level of organization they might decide to droen these unpleasant thoughts out with other louder sounds they make on purpose. And if these louder sounds serve a societal role they will inevitably use it to tell stories, emotions or make sense of their beeing in the world or just try to forget the things that happened in their lifes. Music.
I'm not sure how you're defining music, but I would consider a bird's song to count. On one hand I don't believe music can be reduced to a mating display, but I'm skeptical that music has a biological root in processing memories/emotional response. Sure, it can stimulate memory/emotional processing, but so do most other social activities. Moreover, I think conversation, games, music, dance, etc. are much more similar to each other in that regard than dreaming is to any of them.
In my experience, dreams are wild extrapolations/interpolations of various waking experiences. When I'm awake, I would call this imagination, but the unconscious mind appears to put the imagination into overdrive in a way that is not possible while awake. It's almost as if the brain is trying to generalize memories, possibly to optimize them for storage space. (or some biological equivalent)
Interestingly, /u/undershirt mentions that it might be that you don't actually experience the dream until you wake up. This would make sense, as this process would be interrupted, leaving you with some bizarre false memories. The unconscious then quickly cleans up it's mess and hands control over to the conscious mind.
On the other hand, I think music is explained fairly satisfactorily as a positive social activity, related to dancing, both of which were ubiquitous and inseparable in ancient cultures. In a world where you have to make friends and be wary of enemies, it's not hard to see how bonding activities that signal friendliness are valuable for natural selection. Even birds sing, humans just have a much more complex songs.