Some certainly acted with the motivation of stopping Nazis, or at least had considerations other than pure science. Notably Oppenheimer, who was quoted thus after witnessing the first nuclear explosion: "I am become Death, the destroyer of worlds."
But others, best exemplified by Edward Teller, didn't concern themselves with such liberal arts nonsense, and merrily continued building larger and larger (and–actually more dangerous–smaller) bombs after Germany was long defeated, and before the Cold War's weapon's race had begun.
And, of course, the Trinity test mentioned above only happened three months after Germany's capitulation. Since afaik none of the scientists quit and the Manhattan project continued unabated, the idea that it was solely motivated by the fear of a German bomb seems somewhat...strained.