What we see in the Bible is God giving instructions to regulate a preexisting way of life that was pervasive at that time. Slavery was everywhere in the ancient world, embedded in the economic and social institutions of those times. God did not affirm or endorse slavery, but worked within the cultural framework of that time to begin a longer process of transformation that would lead to moving people out of slavery in any and every form.