I would see some sense in wanting to keep your country free of gangs, thieves, murderers, rapists, kidnappers, etc etc etc.
Who doesn't want their country free from them? That isn't the problem.
I would guess (in the mind of this guy) even if to 'stop them', you'd have to become one yourself?
I can understand that too, and It's stupid. He did more harm to Norwegian citizens than 100 average immigrants ever could or would want to, and all because he was worried about harm being done by immigrants. The way I see it is, he thought some people were OK to hurt and some weren't.
There is somewhat of a relation in between immigrants of low educational and income level living confined and in poverty, and the rise of crime rates.
While that might be true, the human tendency is to run with things and not remember that while the correlation is that crime is higher in immigrants, that doesn't say anything about immigrants as a whole. Punish people for crimes, not for being someone who other criminals have a similarity to.
For the most part, an Immigrant is somebody who is changing their life in order to have a better future for them and their family, just like you or I would if we lived in a shithole. Not someone who is changing there life to fuck with yours.
As always, a balance is needed, but you can be sure as hell you don't have that balance if the first thought after a terrorist attack is that it's foreigners doing.