It is, in fact, a heck of a lot more complicated than that. Mostly the U.S. went to the moon to provide civilian cover for R&D investments in I.C.B.M. and satellite surveillance technology. If you are interested I suggest reading "Red Moon Rising", which covers quite accurately the early players and their politics and motivations on both sides (from the V-2 in WW2 to Yuri Gagarin and Kennedy's declaration).