Seems pretty straightforward. If you want slaves, take them from your neighbors, not your fellow Israelites.
I mean, what are you really expecting out of Iron Age spirituality? The laws of God had to suit their society, and their society had slavery. Eventually we decided that morality made it repugnant. But it wasn’t until the economic case for slaves was all but dead in all but a select few places.
God didn’t make humans into slave-owners. We did that to ourselves. God knows that we’re not going to just give it up, and if He tries, we just won’t listen to Him. So He compromises and tells us to not make slaves of our kinsfolk.
As repugnant as slavery was, it was far from the worst of our sins.