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.
It's just the WW2 version of "You were so preoccupied on whether or not you could, you didn't stop to think if you should"
Now there's lots of debate on if nukes resulted in the unsteady peace we benefit from today, but fact of the matter is two cities that existed, stopped, existing.
Edit: I'm being a bit hyperbolic but the point still stands.