It's easy to look back 4000 years and say "damn their values are not modern enough 🧐" 🤦♀️ but hey buddy, you don't have to look back that far. Your very recent forefathers took slaves for themselves in plenty 🌚 Despite that, God did not command them to take slaves, nor did he want for people to take slaves and you don't have to look far to find evidence of this, but God knew that people would do what they see fit with their free will and therefore laid down some basic rules, which they previously did not have. Partly because, for many people, becoming a slave was the only way to survive.