I was driving to school one day, listening to the radio, and I realized that I could sing along with pretty much every song that came on--even ones that I hadn't heard in years (I was listening to the classic rock station). Now, there is no way that I could repeat anything anyone said to me verbatim, even if they had just finished speaking moments before. Something about the music format seems to really facilitate memory. Design? I realized that music, unlike speech, is not generative. There is a huge number of different sentences that will convey the same idea; what one remembers is the idea, however, not the precise sentence used to communicate the idea. Music is the opposite--one remembers the precise sequence of words and melody, even if you have no idea what the song means. People still argue about the meaning of "Stairway to Heaven," and there probably isn't any meaning.
OK, what is the function of being able to readily remember a precise sequence of words and melody? Synchrony. This allows multiple individuals to synchronize their signaling. And why would that be functional? In order to signal the existence of a coalition. That's my hypothesis. Music allows a group of individuals to honestly and effectively signal to others that they are a coalition, and not just an uncoordinated bunch of losers. This would be very important in alliance formation and warfare--two activities that frequently involve music (and dance too). By putting on an impressive display of music and dance, one group can signal to the other that they are an effective coalition. The only way could have learned the same songs and dances is if they have been cooperating for some non-trivial amount of time.
Don Symons pointed out that applause is specifically not synchronized. If it does become synchronized, then at that point the audience has joined in the performance and becomes part of the coalition.
Rock bands are little coalitions that groupies and fans want to join. Rock musicians really play up the coalitional nature of performance, exaggerating the synchrony of their guitar playing, etc. As for listeners, they are more impressed when the music involves different but complimentary parts--a bass line, percussion, vocals, melody, harmony, etc. A new coalition would only be able to have everybody sing the same thing. Only an older, more reliable coalition would be able to pull off the more sophisticated musical and dance forms.
Music and dance are compact, efficient data structures for signaling coalitional status to other coalitions. There may be intracoalitional functions as well. Participation in a funeral dirge will signal to others in a coalition that you are investing in the coalition--the emotional signaling part of music.