Where there is a will, there is a way. The Western world also abolished slavery despite World wars 1 and 2. But Islam not only didn't abolish slavery, but it even usurped many human rights, which could be very easily given to slaves.

Muslim preachers come up with this excuse:

Look how the black African American slaves, after being set free by the 13th Amendment, suffered and some of them died after being freed. Thus Islam couldn't abolish slavery because then the slaves would suffer the same fate as the black American slaves.

Simlialry, every war brought slaves, and Muslims could not have abolished it one-sidedly, when Kuffars were also enslaving Muslims after wars. 

Moreover, the economy was directly linked with slavery, and it was impossible to completely abolish slavery, and to give freedom to all slaves who were the private properties of their owners, who bought them from slave markets. 

Response:

Firstly, the Muslim argument about African American slaves holds no value. Slavery was also abolished in the whole of Europe, but no such problem occurred in Europe. Actually, The British Empire also abolished slavery from all its colonies all over the world, and still, slaves faced no such problems in those colonies. 

Actually, it was the "Racial Prejudice" of the white supremacists in America, which played the most important role in bringing hardships to African American Slaves later after their emancipation. The question is if Sahaba (i.e. companions of Muhammad) also had such "Racial Prejudice" against all slaves that Allah/Muhammad feared and thus didn't dare to emancipate slaves in the Islamic state.

Secondly and most importantly, if ongoing wars were bringing more slaves every time, still Allah/Muhammad could have given slaves more human rights, which could have reduced their sufferings. But Allah/Muhammad failed miserably in providing the slaves with even basic human rights

For example, Ashoka the Great of India was also not able to completely eradicate slavery due to ongoing wars. However, he successfully eliminated all forms of slave trade and slave markets within India.

Here is a list of some basic human rights, which Allah/Muhammad could have very easily provided to slaves, and his companions would have not rebelled against Allah/Muhammad. The economy of the Islamic State would have also not collapsed due to those basic human rights:

  1. Allah/Muhammad could have at least ordered if anyone desired the captive woman, then he should marry her, and should not further sell her to another man after a temporary sexual relationship. If the Bible successfully gave this right to the poor captive and slave women thousands of years before Islam, what then stopped Allah/Muhammad from giving this important basic human right to the captive/slave women? Instead of that, Allah/Muhammad made the repetitive rape and repetitive sale of slave women Halal in the name of temporary sexual relationships. [More details here]

  2. Allah/Muhammad could have at least abolished the rape of the virgin and small girls on the first night. If the Jews and the Christians (who were the neighbours of Muhammad) were following the rule of the Bible and not raping captive women and girls for the first full month for thousands of years before Muhammad, why then was it impossible for Allah/Muhammad to do the same? [More details here]

  3. Had Prophet Muhammad wished, then he could have allowed the slave women to take Hijab (when they were not working) and to cover their naked breasts. It has nothing to do with economic conditions but with basic human rights. But Allah/Muhammad went towards the opposite direction. Not only breasts of slave women were kept naked, but they were also beaten with sticks if they ever wished to cover their bodies by wearing a Hijab. [More details here]

  4. Allah/Muhammad could have accepted the testimony of slaves in the court, and Sahaba would not have revolted against Allah/Muhammad for that, while it has nothing to do with the economic situation. But Allah/Muhammad wanted to dishonour the slave men and women. In fact, Islam/Muhammad didn't even allow the non-Muslims to give testimony against any crime of any free Muslim man in the court. It was also in order to humiliate the non-Muslims. While Allah/Muhammad usurped the right of "witness" from slave women, thus those poor women were not even able to go to the courts and give witness against the rapist who raped them, or against their own owners if they forced them into prostitution. That is why verse 33:59 tells that Sahaba used to sit on the roads and used to sexually molest the slave women. And Allah/Muhammad didn't punish those companions but only differentiated the free women from the slave through the use of the Hijab so that Sahaba didn't then molest the free women. [More details here]

  5. Allah/Muhammad could have easily spared the old elderly men by not killing them after taking them as prisoners. Did sparing the elderly men would have destroyed the economy of the mighty Islamic Caliphate?  [More details here]

  6. Allah/Muhammad could have easily declared that the life of a slave had equal value as that of his owner. And he could have easily imposed Qisas (or any other kind of physical punishment) in order to discourage the owners to beat or to kill their slaves. Merely giving a recommendation not to slap them was not enough, and there should have been any physical punishment for the owners for beating or killing them. Again, this has nothing to do with the economic situation, but basic human rights. Had Sahaba revolted against Allah/Muhammad if they had declared the blood of slaves equal to their owners? [More details here

  7. He could have allowed the slaves to indulge in love, and to marry the woman of their choice. Would giving such basic human rights to the slaves have really destroyed the Economy of the mighty Islamic State? [More details here

  8. He could have prohibited the Muslim masters from destroying the slave family by taking the wife of his male slave for his lust and raping her. [More details here

  9. He could have ordered that owners were not allowed to disown the parentage of their own children from their slave women. How much did it affect the Economy of the Islamic State? [More details here

  10. He could have ordered to end of the institution of “Slavery by Birth” (i.e. children of slaves are automatically born as slaves in Islam). Did that really destroy the Economy of the mighty Islamic State? [More details here

  11. He could have ordered that it was not allowed to separate the babies (after they got two molar teeth at the age of 6 months) from their slave mothers and then sell them in the Islamic Bazaars of Slavery. Did the prohibition of such sale of 6-month-old babies really destroy the economy of the mighty Islamic State? [More details here

  12. If any slave fled away, then it means he wanted to live as a free man. But Muhammad ordered the slaughter of the slave if he fled. Why? [More details here]

  13. He could have prohibited the “private ownership” of the slaves and could have declared that all the captives/slaves should only be kept in the ownership of the State. For example, the Law of Draco (which was written 1200 years before Islam), declared that only the State had the right to own the slaves (link).

  14. He could have at least ended the Bazaars of Slavery, where poor slave women were paraded half-naked, and the buyers were even allowed to touch their private body parts too. If Ashoka the Great of India could have ended the Slave Trade and the Bazaars of Slavery 800 years before Islam, why then Muhammad (or powerful Muslim rulers like Umar Ibn Khattab) were unable to end the slave trade and the Bazaars of Slavery? [More details here]

  15. He could have at least ended the slave trade with the non-Muslim countries, where the Muslim owners were even able to sell the Muslim/Jews/Christian slave women to the Polytheists, who raped those women, although those slave women believed in God (Reference: History of Tabari, vol. 8, Page 39 under the incident of Banu Qurayzah). After that Prophet Muhammad handed over the captive (Jewish) women to companion Saad bin Zayd, and sent him to the area of Najd, so that he could sell those captive (Jew) women there (to the polytheists) and buy weapons and horses from that money.

  16. Muslim Bazaars of Slavery were notoriously famous throughout the world and became one of the major sources of income for the Muslim community. But such an economic source from slavery is even worse than the economic sources from other crimes like stealing and robbery. 

  17. He could have replaced the institution of slavery with the institution of Serfdom (like the Buddhist Governments of the 13th century did for the sake of humanity, and to give basic human rights to the slaves (Link). If the normal Buddhist States were able to do it, why then Muhammad or later coming powerful Muslim rulers not able to do it?

As the wise people say: “Where there is a will, there is a way”. But Allah/Muhammad was unable to find ways to end slavery, or even to give basic human rights to the slaves, while they didn’t will it. Otherwise, Muhammad and other powerful Muslim rulers got all the full power and economic stability to abolish slavery completely.

In conclusion, even if Muhammad/Allah was not able to abolish slavery completely, still he was in the position of providing the slaves with these basic human rights, thus reducing their sufferings. But Muhammad/Allah failed miserably here.

And in many cases, Muhammad/Allah even INCREASED the sufferings of slaves (like raping captive/slave women in Temporary sexual relationships Halal for Mulsim men and then selling them to another master). While Muhammad's neighbours (i.e. the Jews and Christians) were neither allowing the practice of temporary sexual relationships with captive/slave girls, nor they were allowing multiple masters to rape their shared slave girl, nor they were allowing the swapping of slave girls, nor they were allowing the masters to take the wife of their male slaves for their lust.