There's a difference between being a good country and being a global force for good. In helping to defeat the Nazis, the U.S. was a global force for good regardless of what else they did, had done or will do. The same with Stalinist Russia.
And then they took all the top scientists from Germany and Japan, who were guilty of crimes against humanity, and made them high ups in the American government