I am not sure that the Church ever held that slavery was moral--at least at the universal level.  My understanding is that the Church tolerated the institution, then eventually condemned it.  

The problem in talking about slavery and what the Church did or did not teach is that we tend to look at slavery through the lens of the history of the African American struggle for liberation.  We see that the US bishops were largely silent when they should have spoken out against the institution. We conclude that the "Church" taught that slavery (as experienced by the African Americans) is moral.

It is true that the US bishops did not speak out as they should have--however the popes had already condemned slavery.  The bishops were just dissident---because of the political climate at the time.  They ignored and downplayed papal teaching on slavery. They pretended it did not exist or was not binding.

Not to sound like a liberal, but the issue is more "nuanced" than you think.