Why did God regulate slavery while prohibiting homosexuality, Sabbath breaking etc?
I have been pondering the issue of slavery in the Bible over the last few days as it is one of the main reasons I object to Christianity. In the OT God gives clear instructions to the Israelites on how they are to purchase and treat slaves. While many of these were indeed progressive for the time and were accompanied by the return law I still can't help but feel that merely regulating slavery is a massive problem for the unchanging nature of the moral law that most Christians subscribe to.
God is very concerned with relatively innocuous sins such as same sex relationships, fornication, adultery and Sabbath breaking to name a few, all of which carry the death penalty. Many other sins require capital punishment as well, with God even being willing to engage in the destruction of entire cities that disobey him with even the children not being spared his wrath. This stands in stark contrast with how he treated slavery and indentured servitude, both of which were perfectly legal under the law. This is, it seems to me, an arbitrary application of what is supposed to be his absolute moral law.
I know that Christians will defend this by refering to Exodus 21:16 and Deuteronomy 23:15-16 but this is surely at odds with what comes later in the same chapter where God affirms that beating slaves as long as they get up after a day or two is fine and with the most damning verses regarding slavery Leviticus 25:42-46 where a distinction is made between the indentured servitude permitted for fellow Israelites and the purchase of slaves from the surrounding nations with direct reference to the slavery suffered by the Israelites in Egypt.
It is clear that the OT explicitly condones slavery. The argument I usually hear in defence of this is that God could not prohibit slavery as he did other sins because the hearts of the Israelites were hard, so he opted for gradual change over an outright ban. From everything I have written I think you can guess my objections to this argument. I do not understand why God does not afford the same pragmatism to far lesser crimes. I do not see how banning some practices and merely regulating others constitutes a moral law that transcends time and culture as Christians generally claim. Lastly I don't understand why and all powerful and all knowing God would be unable to leave no ambiguity in his opposition to slavery. He had no issues with razing Sodom and Gomorrah for their sin, having a man killed for gathering sticks on the Sabbath or even submitting Egypt to the ten plagues but when it comes to slavery he is suddenly bound by the constraints of a fallen world. Why is this?