There are many purposes of music and they vary according to the artist:
--To provide entertainment
--To express points of view, political opinions, etc.
--To arouse emotins that inspire or motivate people to think or do certain things
--To offer praise or worship in a religious context
--To express feelings of love, patriotism, or anger
--To provide complement to movies, theater, dance, etc.
I do not think there is any one thing music "should" do, but at its most basic level, it at least has to entertain, or no one would want to listen to it.
_________________________
"Why don’t you write books people can read?"
- Nora Joyce, to her husband James