First of all, we would like to stress that Islam caters for rights of every creature. It urges a Muslim to show good and kind treatment to anyone under his/her control; he should neither maltreat him or her nor should he subject him/her to any form of exploitation.
Islam totally objects and fights all forms of slavery. The focus of Islam in all its teachings and rites was to eradicate this prevailing practice. Now, slavery has been abolished by international conventions, and this goes in line with aims and objectives of Islam.

When Islam was reveled to Prophet Muhammad (peace and blessings be upon him), slavery was a worldwide common social phenomenon; it was much older than Islam. Slavery was deeply rooted in every society to the extent that it was impossible to imagine a civilized society without slaves.
In spite of this social fact, Islam was the first religion to recognize slavery as a social illness that needed to be addressed. Since slavery was deeply rooted in the society, Islam did not abolish it at once. Rather, Islam treated slavery in the same manner it treated other social illnesses. Islam followed the same methodology of gradual elimination in dealing with this social disease as it did with other social illnesses, for example: the prohibition of alcohol in three steps.
Concerning having slave women, we would like to let you know that it happens to be a practice necessitated by the condition in which early Muslims found themselves vis-a-vis non-Muslims, as both parties engaged in wars. Slave women or milk al-yameen are referred to in the Qur’an as “Those whom your right hand possess” or “ma malakat aymanukum”; they are those taken as captives during conquests and subsequently became slaves, or those who were descendants of slaves.
thus, it was a war custom in the past to take men and women as captives and then turn them into slaves. Islam did not initiate it, rather, it was something in practice long ago before the advent of Islam. And when Islam came, it tried to eradicate this practice, bit by bit. So it first restricted it to the reciprocal practice of war, in the sense that Muslims took war captives just as the enemies did with Muslims.
But as it aimed at putting an end to such issue, Islam laid down rules which would eventually lead to eradicating the practice. So it allowed Muslims to have intercourse with slave women taken as captives of just and legitimate wars. In so doing, the woman would automatically become free if she got pregnant. What’s more, her child would also become free.
Not only that, but Islam also ordered a Muslim to treat the slave woman in every respect as if she were his wife. She should be well fed, clothed and given due protection. In the family environment, she had the opportunity to learn about Islam and was free to accept it or reject it. She also had the opportunity to earn her freedom for she could be ransomed.
In the light of the above-mentioned facts, and the nature of the question posed by people, it’s clear that some people misunderstand the wisdom behind the permissibility of having female slaves and think that it is meant to unleash men’s desires and give them more enjoyment. Never! That is not the point! It is, rather, means of freeing slaves; and this is clarified above in the fact that if a master got a female slave pregnant, then he could neither sell her nor give her away as a present. And if he died, she would not be considered part of his property. She’d receive her freedom and her baby would also be free.
But, we have to stress that this case should not be confused with that of female servants or maids, for they are free and not slaves. Therefore, it is forbidden to engage in sexual relations with them except through an Islamic marriage.
Slavery has been abolished by international conventions and goes in line with aims and objectives of Islam, as it has called for centuries ago.”

As for the issue of fornication, Islam is clear that it is strictly forbidden for a person to indulge in an illegal relationship with a slave girl of another man or with a married slave girl to the extent that Islam elaborated the had for both who indulge in such crime whether they are free or slave.

Therefore, there is no contradiction between both the prohibition of Zina and having sex with one’s slave girls as long as they are owned by legal means which do not exist now because all means to have slaves have been blocked.

As for the issue of equality and marriage to slaves, it should be clear that in Islam all people are equal, irrespective of their race, language, gender, etc. The only criterion in distinguishing people is taqwah (piety and God-consciousness). Let’s even reflect on the following Qur’anic verse that gives preference to the slave spouse over a free unbeliever:

“Wed not idolatresses till they believe; for lo! a believing bondwoman is better than an idolatress though she please you; and give not your daughters in marriage to idolaters till they believe, for lo! a believing slave is better than an idolater though he please you. These invite unto the Fire, and Allah inviteth unto the Garden, and unto forgiveness by His grace, and expoundeth thus His revelations to mankind that haply they may remember.” (Al-Baqarah 2: 221)

Also, Islam doesn’t say that it’s haram to marry a slave-girl. However, there are other dimensions that we have to consider when discussing the issue of marriage. Islam aims at constructing successful marriages. Therefore, it encourages people to search for compatible candidates. The issue of compatibility is meant to guarantee successful and happy marital life. Compatible married spouses would have mutual understanding, close ways of thinking and conduct, etc. Besides, Islam aims at freeing slaves. When a slave-girl gives birth of a baby to her
master, she will become mother of a free boy, and a free woman after her master’s death.

Having stated the above, it becomes clear that Islam gave slaves certain rights in order to protect them against mistreatment, let alone it put certain legislations in order to abolish this well-established phenomena (slavery) gradually.

Finally, we’d like to add that the institution of slavery, by the grace of Allah, no longer exists in the world. Therefore, the question regarding keeping slaves or marrying slave girls does not arise anymore. We should not pay much attention to such issues which are of no avail or practical use nowadays. Islam encourages its followers to concentrate on issues of real and practical relevance.