One law, yes, love him like thyself, for you also were strangers in Egypt.
He's saying here, You were strangers yourself in Egypt, IE, foreigners there, still your own people, but living in their land. You were in another people's land once, so when other people are in your land, you treat them As If They Are One Of You.
This passage shows the distinction that is maintained, even in their being treated the same, still they are called strangers, and compared to being strangers in Egypt. They were not counted Egyptians, the distinction was maintained throughout their stay, and was what led to their affliction and final expulsion.
God is saying when others are in your land, you treat them right, like one of you. God is not saying, Oh and I forgot . . . who are Abraham's children whom I promised?
I imagine there has been some mixed marriage. And I imagine God knows whom He will return to the promised land when He comes to rescue them.
Much love!