You shall not pervert the justice due to the sojourner or to the fatherless, or take a widow's garment in pledge, but you shall remember that you were a slave in Egypt and the Lord your God redeemed you from there; therefore I command you to do this.
With this firm reminder that every one of the Israelites was a former slave, God asks the nation to commit to justice and to show mercy to the neediest among them. The foreign national (read modern day immigrant --legal or illegal), the widow, and the orphan were the groups at the bottom of the societal structure. And everyone else was commanded by God (that's God commanding at the end) to treat them justly with the reminder that as former slaves they should identify with the plight of these groups.
Remembering their redemption brought a humble perspective on the rest of the world. God asked them to view people first through their own past of God's redeeming them out of misery, hardship, and slavery. This would help mold a caring and compassionate nation. It would serve as a foundational concept in the insurance of justice to all people. It would bring dignity, respect, and understanding to the poorest and neediest among them. It would create a worshipful expression of justice because they would remember that God had cared for them at their lowest.
The principle of remembering redemption to shape character is still very applicable for me. Israel had the Exodus lens through which to view all of life. I have gospel glasses. When I realize that I am the lowest, most miserable sinner who has been redeemed by Christ, it puts the brakes on judgmentalism, bigotry, and any sense of personal entitlement. As is often said, the ground is level at the foot of the cross. From there I am called in grateful worship to see all people as those for whom my Savior died. And he has called me to share the grace of the gospel with all people: rich, poor, immigrant, countryman, widow, orphan, man, woman, or child. And that is a just and regular way to remember my redemption.