almost all of the mathmos I knew really thought GCHQ would be an amazing place to work, and about 50% ended up there, with the other 50% at quant funds (more or less correlated with religion).
this was of course prior to the Snowden disclosures, I'm not sure it's such a hot place to work these days...
I suppose the only way you can do this work is by being delusional, they likely seek the quality out.
I grew up in the shadow of the doughnut (it was sheds then) and they recruited 'second 11' folks from my school, the ones that didn't get A's. The buy in is that they can pay a mortgage, brings some more kids into the world and not have to leave Gloucestershire. They are all kept in little boxes so none know the big picture, except they believe they are protecting the world from Osama/kiddie porn.
Although no hard evidence, I believe the doughnut people also have everyone's school reports too. Imagine the lengths or procedures in place to do that. Yep, the spy on kids.
Religious zealots fit perfectly the psychological profile of the typical alphabet agency stooge.
They're dogmatic, conformists, traditionalists/conventionalists, authoritarians by nature (more specifically RWA[0]), malleable to chauvinistic rhetoric and propaganda, averse and hostile to opposition's rhetoric and dissenters.
That explains why these folks are attracted to these positions and why those spy agencies seek them aggressively and make no mistake some of them are very bright and innovative but unfortunately their brain is severely compartmentalized and the one chamber holding the religious and nationalist stuff is extremely deficient in terms of mental capacity and reasoning.
[0]: https://en.wikipedia.org/wiki/Right-wing_authoritarianism