Israel was the chosen nation, and the other peoples were not. If they were circumcised, then the servants themselves were considered Israelites, via “adoption.” In other words, nothing better could happen to a pagan than to be made a servant in Israel.
While God allowed divorce, slavery, and polygamy, none of these were positively commanded by God.
For instance, in Exodus 21:2, the Sacred Scripture says: “If thou buy a Hebrew servant, six years shall he serve thee; in the seventh he shall go out free for nothing.” Note here that God is not commanding the Israelites to have slaves (servants). Rather, He is merely implicitly permitting them to have slaves. The verse here talks about the regulation of slaves and therefore is an implicit endorsement of slavery. But this is a far cry from God commanding the Israelites to have slaves. This difference is important because the death penalty, unlike slavery, is firmly commanded by God, not merely permitted.
What is referred to in other translations as “slaves” is more correctly rendered as “servants,” as the Douay Bible has it. When we 21st century people think of slaves and slavery, what comes to mind right away is the horrible atrocities committed by white men against blacks in the United States mostly during the 1800’s. But this is not the kind of slavery we read about in the Sacred Scriptures. God asked the Israelites to treat their servants well. Also, as pointed out in Leviticus 22: 10-11, the servants or slaves had some privileges which even some Israelites did not.
See:
A Matter of Justice by Mario Derksen:
catholicapologetics.info/morality/deathpenalty/punishment.htm
“Under Roman Law the slave was a chattel with no more rights than an animal. His master might seduce, mutilate, torture or kill him without any interference by the law.” [Sir Arnold Lunn, *Is The Catholic Church Anti-Social?, Burns & Oates 1946, p 186, 188].
The Church revolutionised the status of the slave long before there could be any thought of abolishing slavery. The inalienable rights of the slave to marriage and then family were safeguarded from the first by the precepts of the Church, and were later secured by legal enactment in the Theodosian code, which was later revised and classified by Justinian (A.D. 527-565). The law followed where the Church had led. The granting of religious equality to slaves was a silent but tremendous revolution – emancipated slaves were often raised to the priesthood and even to the very Chair of St Peter, Pius I and Callistus I in the second and third centuries. (Ibid. p 187).
[See *The Victory of Reason, Rodney Stark, Random House, 2005, p 30].