I won't argue that there isn't cross-pollination between NASA and the military, but if you're looking for a test pilot for your new, high-performance aircraft (or, say, rocket), you'd be hard pressed to find a more qualified candidate than a military test pilot.
That reasoning was used for years to exclude women from the astronaut programme, even when women outperformed men in NASA's own test pilot tests.
(Astronauts were drawn from the test pilot pool. Women could not become test pilots because test pilots were military pilots, and military pilots were not female.)