There are two kinds of slavery a) The relatively modern cruel and inhumane slavery of the past centuries and b) The voluntary slavery in the Bible which was allowed for economic purposes.
A lot of people confuse the two. The indentured slavery allowed in the Bible was not forced and cruel. It was not due to skin color. It was not on the basis that one group of people was superior than the other as far as being a human being is concerned. In the Bible, one man could voluntarily offer himself as a servant to pay up his debts or to provide for his family. He was recognized as a person created in the image of God.
The modern slavery we read about in the past centuries was something that was truly ungodly and evil. We, Christians, denounce it to the heavens.
1Ti 1:9 We also know that law is made not for the righteous but for lawbreakers and rebels, the ungodly and sinful, the unholy and irreligious; for those who kill their fathers or mothers, for murderers,
1Ti 1:10 for adulterers and perverts, for SLAVE TRADERS and liars and perjurers—and for whatever else is contrary to the sound doctrine (NIV)
The slavery of the relatively recent past was a slavery that could do cruel, unjust and evil things against one's fellow human beings. And the Bible condemns it.