But I believe there's a mistranslation or misunderstanding about 'he was a foreigner, and he deserved it'. I perfectly understand this kind of things happens a lot in China, but it has nothing related to the concept of 'foreigner'. Chinese people are more likely to do the same to each other.
The word 'deserved' is obviously '该', which means, in this particular context, more like describing 'That is how things work, and he should not be so careless about other people' instead of being a foreigner is negative for local people or he should be punished by being a foreigner.
But which statement is true is that, where there is profit, there would be Chinese people doing it, despite if it's not ethical. There are a bunch of examples like gutter oil, gene edited babies etc.
As for the foreigner part, generally speaking, Chinese people are much, much more xenophile than xenophobia, at least to western people. Anyone has been to China can confirm this. Most Chinese people would more gladly to lend a helping hand to a foreigner rather than other Chinese people because there is far less chance they would be scammed.