It is often assumed that religion is supposed to make someone a better person, but there are people who have became worse because of religion, from the slave owners of the 19th Century to Mel Gibson.
Do you really believe that slave owners would have freed their slaves if they became atheists? They used religion as a justification.
Religion was one of the reasons for ending slavery.
It was also one of the reasons for preserving slavery.
"Down with the eagle, up with the cross."- Battle Cry of Freedom (Confederate version)