Not something I have much knowledge about, but from the BBC Religions page:
"The legality of slavery in Islam, together with the example of the Prophet Muhammad, who himself bought, sold, captured, and owned slaves, may explain why slavery persisted until the 19th century in many places (and later still in some countries). The impetus for the abolition of slavery came largely from colonial powers, although some Muslim thinkers argued strongly for abolition."
And later: "Muhammad's teaching that slaves were to be regarded as human beings with dignity and rights and not just as property, and that freeing slaves was a virtuous thing to do, may have helped to create a culture in which slaves became much more assimilated into the community than they were in the West."
all in all, it seems that ol' Mo was quite the liberal for those days. Obviously a slave owner, which is never a good thing, but could be worse.
https://www.bbc.co.uk/religion/religions/islam/history/slavery_1.shtml