A combination of reasons. Some artists might have been motivated by religious faith to paint religious works, which would naturally tend to wind up in temples. Temples might have had more money than other institutions or individuals to hire artists. And temples might tend to be more permanent than families or other institutions, so their artistic holdings would be less likely to be sold off or otherwise dispersed over time.
Information from Yahoo Answers