Music has more than one use. Yes, it can be used to entertain. But it can also be used to teach or give information. About 500 years ago, during the time of Martin Luther, people would go to the tavern to hear someone SING the news to them. The telegraph didn't exist back then. So singers or troubadours would go from tavern to tavern and give the people the news in song. This makes a lot of sense. It is easier to memorize information if it is set to music.
Martin Luther's first hymn was an account of the martyrdom of two monks. The hymn was sort of a news account. But it was also a sermon expressing a hope of the spread of the Gospel.
That is why the liturgy of a church has a strong musical component. The music internalizes the liturgy for the worshiper and gives one a sense of where one is at in the worship service. The liturgy also communicates the teachings of the church. The hymns also should provide teaching of doctrine. For example, Luther's hymn "Our Father, Thou in Heaven above" is an exposition of the Lord's Prayer. Theoretically the liturgy, the hymns and the sermon should all work in harmony speaking in unison with one voice. Unfortunately errors can creep into the liturgy, the sermon or the hymnody. That is why pastors and laity must be aware of practice as well as doctrine. For error will sometimes sneak into the church by the backdoor of practice before one is aware of the doctrinal error.
Sometimes music is a more effective tool in teaching people than preaching. Not always. But the advantage of the catchy melody and words, sung far and wide can reach more people than one church sermon. A Jesuit complained that Luther's hymns won more converts than his sermons. Luther's hymns were not just entertainment. In addition to his hymn on the Lord's Prayer, he also wrote a hymn which was the creed or statement of faith put to music. Another hymn of Luther's expounded on the Ten Commandments. It is probably advisable to not try and sing this hymn in one sitting.
This writer saw a DVD which mentioned that Luther wanted his students to learn Latin. He used music as an aide to help them learn. This principle, of using music teach a language, is still in use today. There are some language learning tools which use music as part of the learning process. And some people use popular music to learn a language. Of course this is not always the most advisable course. This writer was told not to listen to J-Pop (Japanese Pop music) in learning Japanese. The singers do not pronounce the words correctly and they sometimes make up words or use their own vocabulary. There are language learning products on the market which incorporate the element of music in learning.