Believing in what the organization does (which could include several different narratives about why its work is good and/or legitimate and/or necessary)
Recruitment via channels that civilian firms aren't using and offering people an educational and career path they didn't expect to have
Recruitment via family, friend, and teacher channels
Wanting to get to know lots of secrets
Wanting to work with smart people
Wanting to work with fancy hardware (for some subspecialties)
Wanting to have one's unusual abilities appreciated and put to use
Wanting to be paid to work on cryptography at all before the 1980s
Wanting to be in a spy movie/novel
Wanting to get to perform real attacks against real people and organizations and not go to prison for it
I know I've met people in all of the first three categories, and I imagine I've met people in the other categories and not known it.