My view on how things should be:
If a person is found planning/intending to harm a country/citizens in that country, regardless of their race, religion, reasons, or where they are from, they should be considered as a terrorist and/or threat to society and therefore be imprisoned, if they are from that country, or deported if they are not - unless they are an extreme threat, for example had done or planned to do something like 9/11, then keep them in said country and do not take eyes off them at all because they are too dangerous to be let lose.
Just like if a person is found to be plotting a kidnap or something similar, they are a threat to society and should be imprisoned.
I do not think that it would be against human rights, nor would it be racist, it would be a country protecting itself and it's citizens.
Of course people do not like the idea of using tax payers money to keep a person imprisoned, but I would rather pay tax for that than to have them lose and being a serious danger to society.
P.S. Sorry if I'm late on the discussion.