Yes, you do misunderstand the parable. The "Good Samaritan" who was engaged in an act of human kindness was the foreigner. The hapless victim on the side of the road was not (at least he isn't clearly identified as such).
The parable is a allegory anyway, which means it has to be understood in both worldly and religious/philosophical terms.
Yes or no: Do you think the Church helping someone regardless of their immigration status should be criminalized?