Asking from a non-Muslim's viewpoint, if Islam preaches equality, then why does it permit slavery?
Even though our Imams and Prophets accepted a slave system, Islam had a plan to free slaves gradually. What people don't normally pay attention to is that if a wrong system has entered a society, removing it needs time and scheduling. If you do something without considering all aspects, it'll have opposite results. It's like something infected with a dangerous virus, or an addicted person who cannot just stop using drugs all of a sudden.
Now if Islam had ordered to free slaves, some of them could have perished when they were an important group in the society. Or a large group of people could became jobless without a place to live in.
Islam consider freeing slaves an "Ibadat", all Prophets and Imam tended to free slaves so simply to give other people a lesson on how it's done.
The Prophet Muhammad (PBUH) said:
«شَرُّ النَّاسِ مَنْ بَاعَ النَّاسَ » Reference
The worst people are the ones who sell humans.
This is a quite popular Hadith among Shi'as.
Islam permits slavery for those who come to fight against Muslims and Islam. Slavery is a kind of blessing for those who are slaves.
To understand this let me explain. Whenever someone is arrested obviously he is an enemy so should be killed straight away because he is enemy and came to kill Muslims but Islam restricts the owner of slaves to keep slave at their homes, provide them as much and good food to them as they have for themselves. Provide them as good clothes as they own have. Let them walk around, let them get education.
These are all benefits he gets. Islam says they should be kept at home because if there were so many prisons it would be a burden to keep them there. Government (Khilafat) would have to provide everything to them. Instead the way I mentioned above is followed so that they (slaves) see how Muslims live and how good their morals and habits are. This means Islam is giving them an opportunity to observe Islam closely.
In the eyes of Islam those who are not Muslims are going to hell so slavery is giving them chance to save themselves from fire of hell and see how good Islam is.
In the end those who observe Islam closely embrace Islam. Also Prophet SAW has already told too many fazail(benefits) for releasing slaves. Therefore in the past we see many top scholars after the Era of Prophet SAW who used to be slaves, people (Muslims) followed them because they became Muslims and were able to lead them.
Sorry I couldn't give any reference here because these are all logical things. References can be seen in other answers.
There are many verses in the Quran discussing slavery, and throughout the life of Prophet Mohammad (pbuh) slavery was fully accepted. There is no evidence to suggest that slavery is in anyway or form banned in Islam.
Narrated 'Abdullah: Allah's Apostle said, "Everyone of you is a guardian and is responsible for his charges. The ruler who has authority over people, is a guardian and is responsible for them, a man is a guardian of his family and is responsible for them; a woman is a guardian of her husband's house and children and is responsible for them; a slave ('Abu) is a guardian of his master's property and is responsible for it; so all of you are guardians and are responsible for your charges." Sahih Bukhari 3:46:730
Based on the above Hadith, Slavery is an element of an Islamic Society.
In Islam the idea behind slavery is that the criminal, or enemy combatant's expenses are paid by his/her owner while the slave is expected to work for the owner.
As such it is seen as a better alternative to a prison system in which the expenses are paid by a group of people who have no control over him/her and in which the prisoner therefore might not be required to work.
Islam has laws governing slavery, if slavery wasn't part of Islam, there would be no laws on it.
I think the definition of "slave" isn't always "(free) labour by force"
If you read Aristotle speak of slavery.
He does not believe that all citizens of captured cities will assimilate. Some undisciplined minds would not be able to adapt to a new culture, language and doctrines on their own. Since they preferred working with their body instead of their mind.
Therefore a society can't educate these people to assimilate. These people wouldn't change by reason. One has to take in these "natural slaves" and assimilate them by example.
Do remember that as a slave master you had to teach your slaves to be intelligent; how to live without a slave master. Those who would buy and sell people that could understand and adapt to a new society did something Aristotle wouldn't condone because these "smart people" would rebel. And the slave owners would use force to keep them, slaves. Only those that didn't rebel, because they prefer working with their body instead of their mind where natural slaves. Most happy as slaves, because they couldn't survive by themselves well.
In the context of your question, a Muslims opinion could be; "Islam allows slavery so undisciplined minds can assimilate to the Muslim way of living"
God knows best.
Islam does not permit slavery to Muslims. In fact one of the requirements of being a Muslim is to not enslave one another (3:64).
But Islam does not force other adherers to other ideology to conform to Islam's belief system (15:3,23:54,43:84,52:45,70:42) even at the expense of death to uphold their beliefs(6:112) at one extreme.
So if there is a citizen (a mushrik/polytheist or kaafir/rejecter of the concept of Prime Creator) amongst the nation and he has a slave who is a Muslim, the nation has no right to take away from the citizen his Muslim slave, because it's part of the belief of this citizen to own a slave, and the nation has no right to take it away from him. Otherwise there would be bloodshed amongst Muslim and non-Muslim to fight for an ideological point of view, which Islam does not want. This is what is meant in the verse 24:32.
وَأَنكِحُوا الْأَيَامَىٰ مِنكُمْ وَالصَّالِحِينَ مِنْ عِبَادِكُمْ وَإِمَائِكُمْ ۚ إِن يَكُونُوا فُقَرَاءَ يُغْنِهِمُ اللَّـهُ مِن فَضْلِهِ ۗ وَاللَّـهُ وَاسِعٌ عَلِيمٌ ﴿٣٢﴾
And marry those unmarried amongst you and the righteous amongst your male and female slaves...(24:32)
That is amongst your male and female citizens that are being enslaved. If we take it that Islam allows slavery amongst the Muslims, it would be contradicting verse 3:64.
So in this verse Allah SWT is talking to us as a nation (with Muslim and non-Muslim citizens) and not as a group of Muslims.