More importantly, the U.S. DoD is a major NASA launch customer, with the Shuttle placing large military payloads into orbits. Other launch vehicles used by NASA are also used by the military from the Air Force Base neighboring Kennedy Space Center and the Air Forces west coast operation at Vandenburg Air Force Base, California.
But NASA also provides key R&D facilities exploring aerospace topics which in turn feed military technology programs.
While NASA does not develop military weapons, it can help in the delivery of orbit based systems which may or may not assist the military mission. For example, the Shuttle placed military payloads are most likely intelligence missions such as reconaissance or SIGINT satellites.
