This is to get out of the cold war
The late President Kennedy constantly pressed the head of NASA in those days and tried to convince him that defeating the Russians in reaching the moon should be the highest priority of the agency, as revealed in the 73-minute long tapes released for publication by the White House about 40 years after the period.
Kennedy and NASA head James Webb held long meetings in November 1962 in which Kennedy pressed that winning the space race might be the key to winning the Cold War. He expected to beat them to get out of the way of going after the Russians.
https://www.hayadan.org.il/BuildaGate4/general2/data_card.php?Cat=~~~329411093~~~8&SiteName=hayadan