How could a kind G-D allow his people to use slavery on their weaker contemporaries and neighbors and yet be so strict with other requirements?
I'll start off by saying that yes, it's troubling. So I'll do my best to quote a few answers I've heard, without saying "aha that answers it."
Sefer HaChinuch (c. 1300) says "the chosen people have a special role and thus were given helpers."
There is a letter from Rabbi Abraham Isaac Kook (c. 1920) where he is open to the possibility that slavery was too baked-in to the society at the time that G-d couldn't have banned it; instead, it was allowed, with significant "nudges" in the direction that it wasn't a good idea (allowing runaway slaves to stay in Israel, freedom upon loss of limb, etc.), to allow for its gradual fadeaway. If I recall correctly, Lord Sacks has said something similar.
- Recall as well that a slave had to be treated decently, and was given a quasi-conversion and had to keep kashrut, shabbat, and quite a bit more. Not all of the commandments, but a lot of them. Upon being freed, a slave's status was the same as a convert's. When you seriously think about just how depraved a lot of societies were in the time of the Bible, Rabbi Ephraim Buchwald suggests that while harsh, this may have been a way of civilizing people.
At the heart of the slavery issue are the questions:
To whom do you belong?
- If your body belong to yourself, can you do whatever you want with your body?
If you can choose to do whatever you want with your body, does that include sell it?
- Also, if I'm in debt, cant I sell myself as a slave to work off my debt?
How do these questions differ between Jews and Gentiles?
As Jews, our bodies are considered Hashem's property. We were once upon a time free-men who owned ourselves, but we became slaves to the Egyptians, and while Hashem redeemed us from them, we are still slaves to Hashem. As a result, like the land of Israel, which is also ultimately God's property, we are not allowed to permanently sell ourselves, only as 'indentured-servants' to each-other for our debts, and for no-more than 6 years. Since our bodies don't belong to ourselves, we also can't get tattoos or make a cut in our flesh, eat whatever we want and many more restrictions. It's a direct result of Hashem being our Master that prevents Jews from selling them-selves. If Jews weren't already slaves to Hashem, Jews would be allowed to sell themselves as slaves.
Gentiles on the other hand are their own proprietors. They were never redeemed by Hashem, so they still own themselves, and can do whatever they want with their bodies, therefore they are allowed to sell themselves as property, if their laws allow for it. Hashem won't change gentile-laws, but he did the next best thing by making a blanket emancipation for any gentile-slave who wants to escape their gentile-master. He can escape to Israel where, under Jewish law, he would be protected as a free-man.
A Jew is not permitted to sell a gentile-slave to a gentile. If he does, that slave must be re-purchased and granted freedom.
A Jew is only allowed to purchase a gentile-slave if he agrees to be circumcised. Circumcision is an acceptance that Hashem is the only God and it's a sign that Hashem is our Master. Basically, this is a light-conversion, where the slave accepts that Hashem is his master as well. This gives the gentile-slave a huge deterrent, and a real choice of whether or not to become a slave to a Jew, especially since he can always refuse circumcision and escape to Israel where he would be protected as a free man.
If a gentile does want to undergo circumcision and become a slave to a Jew, in return for his servitude, the slave must be provided with sustenance. There is no official law dictating how a Jewish-slave-owner must treat his gentile-slave (similarly there is no law against yelling at or hitting your wife and children.), because as an adult the law can't tell you how to use your property, however, it is taught that gentile-slaves should be treated as humanely as possible, even partaking in every meal the master eats, before the master himself eats. He should never be embarrassed or distressed, over-worked, or shouted at, and one should speak to them gently and listen to their claims. Their main purpose is to perform a service, not 'be your slave'.
I once heard from Rabbi Uziel Milevsky that slavery is a necessary consequence of war.
Once you have war, you have slavery. If an army conquers a land and wants to settle it.
The conquering army now needs to get rid of the previous inhabitants.
It now has only two choices - either kill them or sell them as slaves. (Displacing them may not be an option as the neighboring countries may not to accept them.)
so we see, slavery does have its purpose. better to be a slave than dead.
It appears to me that the reason is simple if you understand the hierarchy of the creation.
First, let's familiarize ourselves with the idea that G-d made the Creation hierarchical: some creatures were created of a higher level then others. The simplest hierarchy is ישראל-מדבר-חי-צומח (inanimate nature => plants => animals => humans etc). The humans were blessed with world domination over the animal kingdom and, needless to say, over the plants and inanimate nature.
Who do you think allowed you to kill and eat those helpless creatures, not mentioning "enslaving" them in all possible ways? Who allowed you to chop trees and burn them for your warmth? Those are the laws of the creation. Now, do you want to continue?
I don't think this site allows to go any further, but if you understand the analogy you'll comprehend the idea that every higher creature is allowed to enslave the lowers.
I'll just mention, that at every layer it allows additional subdivision, for example at the level of the Jews themselves there's a possibility of some of them getting to a lower level and enslaving themselves to other Jews.
And, finally, I should remind that we all are the slaves to the Supreme Commander of them all!