Just like in the last chapter, Moses was regulating the people as they were; dealing with matters that were common among them. This doesn't mean that all of his advice was final or universal. In fact, Jesus added some strong commentary on Moses' words in Matthew 19:8 when he negated his permissive position of divorce (Matthew 19:3-9). Much of this is little more than reasonable humanitarian guidelines.
Some would say that Deuteronomy 24:7 was altogether a condemnation of slavery. However, while I am opposed to the institution of slavery, it was indeed common in Moses' day. Moses issued many regulations for how to treat slaves equitably. So, what is this verse really? It is a clear condemnation of the slave trade... but not of slavery per se. There is a major difference in voluntary slavery and compulsory slavery. Becoming a slave to a benevolent owner to pay off a debt was a world away from kidnapping and selling people as slaves.
Many of the verses in this text are devoted to providing for the poor. Jews were to take care when pledges were made that they used restraint and caution in accepting and retrieving them. Men and women would exchange a piece of their own clothing or some other item as a guarantee (pledge) that they would do a thing or pay a price. So, this practice was not to be used for the purpose of oppression.
Moses also said that the Jews were supposed to pay the poorest of their employees on the very day that they did their work (Deuteronomy 24:15). He added that if a poor man had to go to bed in angst because he had not yet been paid... then God would be angry with his employer. And, Moses forbade the close and complete harvest of the vineyards, fields and orchards. The gleanings were always supposed to be left for the poor (Deuteronomy 24:19-21).