There is “religious music,” and there is “sacred music.” "Religious music" instills doctrines and requires a degree of belief on the part of the listener in order to be fully appreciated. "Sacred music" is simply a communication of the known (everyday life) with the unknown (the universe). It may also stem from a religious tradition, but moves the listener beyond the specific domain of that tradition, and is accessible for non-believers as well.
“Religious” and “sacred” are overlapping terms; it is hard to say where one type of music ends and the other begins. Some would argue that they perfectly coincide. But I would argue Bach’s B Minor Mass is an example of “sacred” music in the wider sense. Ecumenical in origin – written by a Lutheran for a Catholic prince, not long after the end of a devastating series of European religious wars – its cosmology straddles the Catholic / Protestant divide and sometimes even ventures beyond Christianity itself.
For example, coming from a traditional Chinese view, I have always heard the Kyrie of the B Minor Mass as a ritual of Heaven, Earth and ancestors. The intricate weave of voices represents the crowd of ancestral spirits who enfold us, and whose inherited habits, quirks and unfulfilled desires make up the substance of our lives. In Chinese the word used in modern times for “God”, Di, originally was a plural term meaning ancestors. The two ideas, God and ancestor, are linked by the idea of Creation - what makes us the way we are, the components that make up our bodies and minds. In modern terms we may call it "genetics."
The two Kyrie fugues, one celestial, expansive and forward-looking in technique, the other earth-bound and looking back toward Renaissance polyphony, speak to each other across space and time. The spirits of past and present, Catholic and Protestant are thus reconciled. The two choral sections of the Kyrie enclose a more intimate central section (Christe eleison), a dialogue between two female envoys (sopranos), one from Heaven and one from Earth, meeting in a middle region of the air.
The beginning of the Gloria section also explicitly refers to Heaven and Earth. Although it begins with the brassy glory of angels soaring through the sky (Gloria in excelsis), the clouds part on the more familiar scene below (Et ab terram pax), a tranquil, pastel landscape of winding rivers, green meadows, absent-minded cows grazing, and village huts with their evening plumes. The transition from Heaven to Earth, the return from the extraordinary to the ordinary, is one of the most moving moments in the work.