Yahweh told the people to love the foreigner because the people of Israel were once foreigners in the land of Egypt.