In a lot of cases, it falls under similar reasons to why the US brought thousands of German scientists during and after WW2 via Operation Paperclip [1] and others, to work in places such as NASA. It becomes a matter of compartmentalizing secrets, understanding the individual's drivers, considering the levels of risks and potential ways to mitigate it, etc.