Oh you're talking about the verses on slavery; iirc any female slave can not only be raped but becomes their property; so they can commence in adultery/ fornication with the slave. The real question is why is slavery even condoned let alone them being treated as properties?
Slavery was a major economic factor throughout the Middle-East, Asia, Africa and Europe for centuries. It was profitable in war as not every soldier in every nation/empire was paid a high wage if a wage at all. Early nations/empires rarely had a standing army like Rome thus many soldiers were farmers, herdsmen, craftsmen, etc, joining as a second job or as forced levies. It was just another form of war loot that could be sold providing as source of income the average person rarely could gain in their normal lives. It was a good incentive for people to join. It also was an income for off-seasons in which normal work could not be done like farming. It was just a standard of the economy thus as normal as the stock market or investments are today. People invested time, effort and money in order for a large payout later.
In Islamic history Muhammad became an outcast from his former place in a well off tribe when exiled from Mecca. We also do not know when the funds he and his first wife, Khadija, ran dry as she died before his exile. She may have been the only factor remaining which made his preaching tolerable in Mecca. He had burned a lot of "bridges" with his anti-polytheism stance so her death could have been the straw that broke the camel's back. From this point he either lived off of whatever money remained, off his wealthy followers or a combination of both. In Medina as part of establishing an alliance against Mecca the wealth of the tribe(s) of Mecca were appealing to groups that were not Muslims. Mecca is depicted as a trade and pilgrimage city between the developed south, Yemen, and developed border regions of Byzantium such as Egypt, Palestine, Syria and Iraq. His wars of conquest within Arabia draw a number of tribes to his cause as per my opening statement. After his death there are records of many former allies, including Muslims, rebelling or just ignoring the emerging Caliphate which is evidence of questionable loyalty to Muhammad, Islam and the Caliphate. His death cut a number of strings for each factor I mentioned.
This does should relative morality since God could forbid a number of things outright such as pork but did nothing about slavery itself. All the anti-slavery verses are for the believers benefit not the slaves. So either God was powerless to stop it, accepted slavery or as I believe all are a product of a human mind set in an environment in which it was normal. Keep in mind Muhammad received a percentage of all war loot and charity to support his emerging life-style. Slavery was acceptable in Judaism and Christianity so it was not a new idea within the line Abrahamic religions. Such an idea is no more than a product of men living in these times thus was justified by religions even outside of the 3 Abrahamic ones.