Really, it was more of a "The Nazis are doing this. We need to get this done before the Nazis so we can prevent the Nazis using it because we will retaliate." The fact that the war in Europe was over before either side had actually finished the bomb made that part irrelevant.
Unfortunately for science, once discoveries are made and turned over to the military, scientsts' morality gets shoved into a corner.