At that time in human history, slavery was a necessity. Cities could not exist, at all, without them (and neither could the benefits of a city, such as education, scientific investigation, high art, defensive walls, etc.).
That feels dubious, slaves were common, but not ubiquitous, and the degrees to which slavery was used varied significantly.
Our technological ascendancy is what eliminated the necessity of slavery. The victory of persuasion over force came when we had the tools necessary to build and maintain a city entirely on paid labor (of workers free to quit and choose other jobs if they please).
Maybe in the special case of Europeans using African slaves, but the real decline would have been political and economic, not technological.
Remember, you still need to "pay" slaves in order to keep them alive so they're not any cheaper at a society wide level. But as property they're a bit easier to track and if you're a rich person you're able to collect the excess production of your slaves, so it creates a little more wealth stratification.
The actual "necessity" was just motivated reasoning. When you defeat your enemies the most valuable plunder is the enemies themselves, so to either keep or sell you might as well grab as many as you can (arguably more ethical than straight up killing them).
The decline would have come from political and economic innovations making it easier to build firms with large stable work forces. I don't think technology explains it well since European slavery did decline in the Middle Ages well before the industrial revolution.
So, without that raw necessity behind it, any (however flimsy) moral justification for slavery has completely evaporated.
The only moral justification I can think of is instead of killing your enemy (so that can't attack you again) you take them as a slave, and cases where someone sold themselves into slavery. Necessity doesn't create a moral justification, it just creates circumstances where you're willing to overlook the moral cost.