He was part of a CIA paramilitary group in Afghanistan. The Afghans that were part of this group were highly vetted. He wasn’t just allowed in the US. He was considered to be very low risk.
I have no idea what set him off and I won’t pretend to be a psychiatrist. What I do know is that the NG troops wouldn’t have been targeted if they weren’t there. Pretty simple…Trump is responsible for them getting attacked.