Exodus 21:7-11“When a man sells his daughter as a slave, she shall not go out as the male slaves do. If she does not please her master, who has designated her for himself, then he shall let her be redeemed."
“The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully.” ― Richard Dawkins, The God Delusion
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.