In my understanding slavery in the old testament days was usually a forum of punishment for going against the Word of God. And why not. Just look at the worship of the so called god Molech. These people were sacrificing infants to that god. Burning them alive. The Hebrews took that on for a time and were made slaves themselves. Justice served because of making hideously bad choices.