Government-funded manned spaceflight programs aren’t done for pure science either. It’s a cool kids club where money is allocated for political reasons (“nation prestige” or some other bullshit). NASA didn’t land on the moon because American senators were fans of science, they were tasked with it to “beat” USSR.
Science-based space exploration should use automatic probes only, anything else is a waste of money.
ICBM development started decades before moon landing, same in USSR. It’s true that first space rockets were reused ICBMs, but the tech diverged after that. ICBMs use different fuel because they need to be stored for years with full fuel tanks, for quick deployment. There is no such requirement for space rockets. Space rockets are also much more powerful - you could fit dozens or even hundreds of nukes on Saturn V which is impractical - you don’t put all your eggs in a single basket. Saturn V was never intended to be used as an ICBM.