Slavery is evil, any god which doesn't condemn it is evil too.
I agree, but let's look at the passage again. Suppose we are the Israelites. We are the owners of the country. If one of us goes into debt, he can live with another one of us until the year of jubilee, when his debt is to be cancelled and he goes back to his property. There are some foreigners living among us who are allowed to own houses in the towns. If one of them goes into debt, he can also live with an Israelite, but the jubilee rule doesn't apply. If they want to remain in Israel, they have to be servants because they have no inheritance. This ensured that the land remained in the possession of the Israelites. If the foreign servant wanted to leave he was free to, as he couldn't be forced to return to his master, but was allowed to choose whom he wanted to work for.
There was no capturing and enslaving involved, unless he had committed a crime. It was equivalent to indentured servitude. I would compare it to the class system, where you have lower and higher class: it is no more evil than that.