As an Atheist , that is , a person who has no religion , it's interesting how much Christian themed music I have in my CD collection. Just some of them. Brahm's German Requiem. JSBach's Mass in B minor and Magnificant. Vivaldi's Gloria. Monteverdi's 1610 Vespers. GFHandel's Messiah. Bruckner's Te Deum. Janacek's Glagolitic Mass. George Lloyd's A Symphonic Mass. Virgil Thomson's Symphony on a Hymn Tune. And that's just the ones I've listened to recently. The one thing that Christianity has done for us is to have been the cause of so much beautiful music to be written. How could such a religious belief system with it's weird 'take' on reality and the human condition produce such wonderful music ? That is surely a subject in itself. Incidentally , I also have several interesting CDs of Pagan music. These are George Lloyd's The Vigil of Venus. Ravel's Daphnis and Chloe Suites 1 & 2. Carl Orff's Carmina Burana. And Arnold Bax's magnificent Pagan march in his 4th Symphony So I suppose these balance out the religious ones.
Religion can certainly inspire some wonderful music and architecture.
Composers from 15th through 18th century Europe had their works commissioned by the king, who was basically a puppet for the church. Your choices as a composer were to keep to religious and church related themes or to be poor and have nowhere for your works to be performed.
It's not that all of these composers were christians. I'd even be willing to bet that a lot of them were closet athiests. They did what they had to do in order to keep themselves from living on the street.