Why was slavery allowed in the Old Testament?

Why was slavery allowed in the Old Testament?

The Old Testament does not present slavery as God’s ideal situation but as a regulated reality in a fallen world. The laws given to Israel restrained abuse, protected dignity, and pointed to God’s deeper purpose of redemption and freedom.