the requirement to treat aliens with dignity and love
Love ye therefore the alien; for
ye were alien in the land of Egypt.
Rashi explains the causal relationship between the two verse
clauses by Filling in with obvious real world background
Don't tease someone else about a blemish that you yourself have
(that is, that you were Egyptian Aliens)
In other words
Since you personally experienced the anguish
you should know better than to cause similar anguish to others.
Here the sermonic point is the driving force of the Rashi.
We should always learn from our own personal experiences and
thereby become more sensitive to others!