People have different ideas about what is necessary. Calling the Manhattan Project "necessary" without thinking much about it is reckless. I've heard accounts from many of the scientists and workers, and many were quite horrified about the results (incidentally, against the Japanese, not Nazis). Presumably many do conclude that developing a nuclear weapon was "necessary," but not without considerably ethical debate.