NASA and defense spending are closely related. Despite appearances the moon shots were military in nature. NASA is currently testing scramjets but this type of aircraft will first be used to deliver bombs. NASA has a more socially acceptable goal than killing people but otherwise NASA is largely the same thing as military research.
True to a point, but I can't think of too many defense aspects to Voyager 1/2, the Viking missions, Pioneer, Pioneer Venus, Galileo, Mars Global Surveyor, Pathfinder, etc.......