It seems like you are misunderstanding the vast ideas at play here, and I will try my best to explain these, God willing.
Nation states are an idea, as are religions, and non-religious ideas such as communism. National-ism is an idea that is no different from tribal-ism, except that it is far reaching to different people(s), who don’t know of each other, each nation has their respective boundaries from which the people of that territory identify themselves as such... American, Canadian, Pakistani, Afghani and such.
Iran has taken upon itself to represent the Shia religious ideologue, and many nationals of different nation states who reside in various territories from which Iran has no authority over also subscribe towards this idea of Shia-ism (not including the variety of sections of it).
The people of these different nations, have of their free will gone to fight for the representatives of Shia-ism (Iran) albeit being citizens of a different nation then the Sovereign nation of the Islamic Republic (Iran).
These actions of their has created a worry, that being... what are their loyalties? Is it towards Shia-ism and their representatives (Iran) or is it to the nation of their belonging? Realpolitik is not concerned with that, rather more upon how to eliminate these potential threats.
The necessary question that follows now is, what is to be done to these individuals? I personally would have them charged for treason and shot by a firing squad, but if the host nation believes in reforming them to be more loyal towards the idea of a nation state, then it can go ahead and do so, but I issue a warning that such loyalties are faulty, nation states appear and disappear all the time, but an ideology is timeless, the Jews have been here for a while and they’ve switched nations many a times, the same of the Christians and Muslims. I urge for caution.