Without looking them up, I think the Bible prefers folks avoid slavery if they can. But back then slavery was the welfare system. Governments existed only to exploit their people. There were no safety nets, no food stamps. If things got really bad and you had no family to care for you, you died in a ditch. Slavery was a way to avoid that. Just like people should avoid welfare today if they can, but if it gets too bad for you, welfare will at least keep you alive. Most admonitions regarding slavery are toward slave owners who had responsibilities to care for their people. Sure they were property, an investment,
but it beat starving to death and I don't think anywhere else in the world did slave owners recognize nearly as much concern toward their slaves as Israel did. After a period of time slaves were offered their freedom and very often they refused, because they had nothing else going for them in the outside world. Criticize the prevailing culture for that, but it's not necessarily slavery's fault.