Well if we're talking about AI risk, the justification that I've seen from researchers is that while they do believe that there is a risk of apocalypse scenarios, they believe that they are better positioned than anyone else to prevent that, and also they believe that the upside of AI is so great for the world that it is worth the risk.
Also I'm not describing what I personally think is an acceptable job; just that I understand that sometimes people do jobs that they think are wrong because they need money