27 Since this is true of works of art in general, it obviously applies also to religious and sacred art. Actually religious art is even more closely bound to God and the promotion of His praise and glory, because its only purpose is to give the faithful the greatest aid in turning their minds piously to God through the works it directs to their senses of sight and hearing. Consequently the artist who does not profess the truths of the faith or who strays far from God in his attitude or conduct should never turn his hand to religious art. He lacks, as it were, that inward eye with which he might see what God's majesty and His worship demand. Nor can he hope that his works, devoid of religion as they are, will ever really breathe the piety and faith that befit God's temple and His holiness, even though they may show him to be an expert artist who is endowed with visible talent. Thus he cannot hope that his works will be worthy of admission into the sacred buildings of the Church, the guardian and arbiter of religious life.
Source: Musicae Sacrae (Vatican.va)