In the Old Testament nation of Israel, God allowed slavery in the cases of:
Critics of the Bible use this fact to argue that the Bible is immoral, because it condones slavery. This article will cover why it's not immoral, and why God's Law makes logical sense, and offers protections for people in a wide array of circumstances, but since the Bible is the standard of morality, if someone were to come to the conclusion that it is immoral, they would lose.
Society, or a person's opinion, is not the arbiter of absolute truth or morality. If God says something is permissible or not allowed, regardless of what anyone thinks, that's the way it is, and disagreeing with an all-powerful God that defines morality does not change reality. It simply puts a person at odds with a God that has all power, which will see them lose every time, as they have no authority or ability to override God's declarations.
The word "slavery" has been used to represent situations that are worlds apart from one another, and so pretending that "slavery" only means one thing, and that thing is always abusive and immoral, is illogical and dishonest. The Word of God does not condone the common type of slavery that we have seen throughout history.
The quintessential form of historical slavery is where armed people show up to a house, steal an innocent person, ship them away to a distant nation, and then treat them like dogs. This behavior is given the death penalty by God:
Exodus 21:16
16 And he that stealeth a man, and selleth him, or if he be found in his hand, he shall surely be put to death.
That means that Israelites could not have any participation whatsoever in the typical historical slave trade, because it carries the death penalty under the Law of God, at every stage.
So, in some sense, the Bible does not condone "slavery", because there are different types of "slavery" which are entirely unjust according to the Law of God.
What about corporal punishment, though? Isn't that abuse? No, it's not, in a lot of situations, Biblically speaking (Proverbs 13:24, 22:15, 23:13-14, 29:15, etc.), and disregard anyone who says it always is, because they are calling God a sinner (Hebrews 12:6, Revelation 3:19, etc.).
Obviously, there are going to be people who find themselves enslaved, for whatever legitimate reason under the Law of God, who refuse to work. They are legitimately enslaved, yet intentionally mess up or sabotage their job, work absurdly slowly, or simply refuse to work altogether. Corporal punishment is required in that situation, in order to make the system work, otherwise the owner is being defrauded of labor that legitimately belongs to them, according to God.
However, there were limits on the type of punishment that could be carried out. For instance, we are given two examples in which slaves would be freed altogether if they were injured in a punishment - damaging an eye (Exodus 21:26), or knocking out a tooth (Exodus 21:27). But, in light of those examples, what is the spirit of the Law? If a slave receives permanent damage from a beating, the owner has exceeded their boundaries, and so the slave would be deserving of freedom.
This, of course, extended to protecting the slave's life. In the same chapter, we are told that if someone killed a slave, they would be punished:
Exodus 21:20-21
20 And if a man smite his servant, or his maid, with a rod, and he die under his hand; he shall be surely punished.
21 Notwithstanding, if he continue a day or two, he shall not be punished: for he is his money.
The passage establishes that an owner is allowed to use a rod to punish a slave. If the owner kills a slave, they will be punished. If the servant is able to continue his work after a few days, no action would be taken against the owner, because the slave is their property, under the Law of God.
Puzzlingly, verse 21 above is used to by Atheists and others to claim that a slave could be beaten to death, and the owner would not be punished, if the slave lived a few days after they beat them, and then they died later. That is not what the verse says, at all. As stated above, "continue a day or two" refers to the slave resuming work.
However, let's think about the claim that these people are making. They want us to believe that a slave would be freed entirely for getting a tooth knocked out, or eye disfigured from a beating, yet could be killed without penalty if they managed to survive for a few days after a beating that would ultimately kill them, whereas at the same time they would've been avenged had they died right away. It's such a logically bankrupt, dishonest twisting of this chapter. Abusing slaves was not permitted, much less killing them.
So, God does recognize corporal punishment as legitimate, and also recognizes that beyond a certain limit, it does become abuse. This offers protection for both parties.
There are those who would argue that treating a human being like property - where you have right to their labor, by force - is dehumanizing, and immoral, regardless of whatever the extenuating circumstances are.
To that I would say, prove it. What are you basing that on? Are you the final arbiter of right and wrong?
Ultimately, disagreeing with God on a moral issue is declaring that, despite not having all knowledge, and despite being a human sinner, your subjective morality is superior to God's. God has His own subjective morality, but since God is omnipotent, omniscient, and perfect, He is the only one qualified to have His subjective morality declared objective. No one else has a claim that can even approach His authority, or knowledge, to challenge any of His conclusions. He makes His decisions based on all of the facts; a human being cannot.
People who found themselves in debt in the ancient world didn't have "bankruptcy" as an option. Captives of war didn't have "repatriation" programs. If you found yourself in these situations, you were going to serve somebody.
If you were from a wicked nation, as far as practical outcomes are concerned, it would be far better to find yourself as a slave to an Israelite than a slave to anyone else, or in some nations, likely better than being free. Don't discount the eternal value of living, whether bond or free, in a nation that is dealt with and chosen directly by the God of the universe.
Also note that there were provisions made for slaves that wanted to stay with their masters even after being given leave (Deuteronomy 15:16-17, Exodus 21:5-6), proving that this was not at all an unbearable experience.
The people in the Bible, then, that were slaves, deserved to be so according to God. It was not an unbearable existence, nor was it a position that allowed you to be abused, according to God.
Since absolute morality is defined by God, it's impossible for any of this to be "immoral", unless you have found someone more powerful than God who is able to enforce their own invented morality over Him.