Rabbi Samson Rafael Hirsch, Commentary to the Torah,

You shall not wrong a ger (Non-Jew living among you and living by your rules) or oppress him/her, for you were gerim in the land of Egypt. (Exodus 22:20)

The great, meta-principle is oft-repeated in the Torah that it is not race, not descent, not birth nor country of origin, nor property, nor anything external or due to chance, but simply and purely the inner spiritual and moral worth of a human being, that gives him/her all the rights of a human being and of a citizen. This basic principle is further protected against infringement by the additional explanation, "For you were gerim in the land of Egypt." ... Your entire misfortune in Egypt was that you were “foreigners” and “aliens." As such, according to the views of other nations, you had no right to be there, had no claim to property, to homeland, or to a dignified existence. It was permissible to do to you whatever they wished. As gerim , your rights were denied in Egypt. This was the source of the slavery and wretchedness imposed upon you. Therefore beware, so runs the warning, from making human rights in your own state conditional on anything other than on the basic humanity which every human being as such bears within him/her by virtue of being human. Any suppression of these human and civil rights opens the gate to the indiscriminate use of power and abuse of human beings, to the whole horror of Egyptian mishandling of human beings that was the root of abomination of Egypt.


haggadah Section: -- Exodus Story
Source: http://rhr.org.il/eng/wp-content/uploads/Rabbis-for-Human-Rights-Haggadah-Supplements-5775-English-American-letter.pdf