Religion is definitely not a source of morality. The delusion that it is a source of morality, however, is an essential part of its product line. That delusion is necessary for the creation of the warm, fuzzy cocoon that lets its customers think they are good people, part of a good group, all of whom will never die.
The true nature of religion was revealed once again recently by the Pope's little "trial balloon" regarding condoms. Clearly, as usual, the Church is being brought forward by public opinion to see true morality. But, as an authoritarian organization, it has to be very careful about changing its mind or else the flock might catch on that it doesn't actually have a pipeline to god but merely pretends to by reflecting what people (i.e., its "customers") think god would want. If you are running a long term con game based on convincing the "marks" that you are "the" authority, you can't let them notice that you have no more authority than any other pedophile in a dress.
I am sure that what Mark Twain said about the moral leadership of religion more than 100 years ago will eventually be just as applicable to this topic as it is to the Church's attempt to re-write history about slavery and, more recently, the Nazi holocaust.
"[N]ow at last, in our immediate day, we hear a Pope saying slave trading is wrong, and we see him sending an expedition to Africa to stop it.
"The texts remain: It is the practice that has changed. Why? Because the world has corrected the Bible. The Church never corrects it; and also never fails to drop in at the tail of the procession--and take the credit of the correction. As she will presently do in this instance."