The Manhattan Project succeeded, so clearly some people are ok working on this sort of thing. And with similar justifications: if we don't build the potentially world-ending bomb, someone else might beat us to it.
That was openly a military project during wartime (and not being pitched as the solution to all problems at the same time so no cognitive dissonance required)