Sayyiduna Abu Hurairah (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) forbade the earnings (from fornication) of slave women.
Brief Explanation
(Commentary on Hadith 2655)
In the era of ignorance (Jahiliyyah), people used to earn unlawful income through their slave-girls and would forcibly make them practice prostitution.
Islam has strictly prohibited this and has declared such earnings as unlawful (haram) sustenance.
In the Noble Qur’an, Allah the Exalted says: «﴿وَلَا تُكْرِهُوا فَتَيَاتِكُمْ عَلَى الْبِغَاءِ إِنْ أَرَدْنَ تَحَصُّنًا لِتَبْتَغُوا عَرَضَ الْحَيَاةِ الدُّنْيَا .....﴾ [النور : 33]»
Translation: “And do not compel your slave-girls to prostitution, if they desire chastity, seeking the temporary interests of worldly life.”