If a fellow Jew becomes desperate enough to become a slave, we are commanded not to work him with slave labor (25:39). If having a Jewish slave does not allow us to treat them as slaves, why does the option even exist? Also, as a nation that knows first hand the horrors of slavery, why does the concept of slavery even exist in Judaism?
The Rambam explains (Guide To The Perplexed) that all processes in nature are gradual and that it would be impossible to suddenly discontinue things that the world was accustomed to. Instead, G-d limited and humanized the practice until humankind would decide to abolish slavery of their own choice. Rabbi Jonathan Sacks submits that this was done by changing slavery from a condition to a circumstance, from what I am to a situation in which I find myself now, but not forever. If someone was reduced to slavery, it was a temporary situation, not an identity. We work to enjoy and appreciate our freedom, and the depth of our history gives us the perspective to acknowledge and value the freedoms we have today.