The moon mission and ICBMs have almost nothing to do with each other, unlike the first satellite, which was a clear demonstration of the capability to deliver intercontinental payloads and was launched on the rocket literally designed to be able to deliver nuclear payloads to the continental US.
The moon mission had only one goal: to save the face after the US has lost all meaningful milestones to the Soviet Union and to "win" the space race by moving the goalpost. I am quite confident, that if the Soviets has managed to land on the Moon first, the goalpost would've been landing on Mars.