What should music do? The easy way out is to say that there is not just one thing that music should (or can) do. Let's try and make a list of some of these: music should please the ear, tell a story, play tricks on our memory, spur the senses with abstract movements, move our souls and so give meaning to our lives - et cetera. Some of these actually overlap. I think such a list could be infinite, or at least very long. The question rests, now in a different form: is it possible to totalize these purported functions of music and come up with a defining formula?
A premature answer would be, simply: no. Music, like any other percept, has myriad functions, effects and uses, attractions and advantages. But the correct answer is much simpler: music can, by the workings of all faculties mentioned above, resonate with human beings. Music resonates in our hearing and leaves intellectually detectable imprints. The first and in fact foremost of these is the mood. All other peculariaties and points of interest come afterwards and are secondary - often auxiliary.
Is the function of music then to generate moods? Not in the least. But the result of a good piece of music will be a resonating mood - the placement of a person in a world. This is the existential duty of music. This is what I aspire to, when I compose.