The best brains do not usually work for the military, most inventions where not invented for military purposes, take fire, irrigation, drainage, even the internet, these where created for people to have better lifes. I would say it is the most part with most other inventions. Nuclear theory came from scientist not interested in building a nuclear bomb, but curios about the nature of atoms and sub atomic particles. The military took it to create weapons, but the science was not discovered in some secret military lab.
The true is the same for the internet, it was just scientist wanting to make things easier for themselves before the military thought, hey that is a good idea for us too.
Here is an except from Popular science magazine:
The story often goes that the Internet began as a means to maintain military command and control in the event of a nuclear war, and while that was surely in the back of everyone's mind, Arpanet was established mostly as a way to cut down travel time for computer scientist. Back in 1962, when Joseph Licklider first began thinking about computers talking to each other, a computer took up a entire room, and users had to schedule time on the few powerful computers available around the country.
Rather than moving around to different massive mainframes, the Arpa scientists wanted to link the computers so a researcher at one institution could do work on a computer on the other side of the country without physically being there. By October of 1969, the first electronic message was sent from UCLA to Stanford: only the letters 'l' and 'o' (for 'login') made it through before the system crashed (the first Web outage!), but it was enough to set in motion a system that would in a remarkably short time change the world.
You can see the whole article here entitled happy 40th birthday internet, http://www.popsci.com/technology/article/2009-10/happy-40th-birthday-internet. It is science that helps the military not the other way round, what new material has the military discovered, what cure has the military discovered, what new property has the military discovered, the military takes from science.
Do not take to heart that the military has contributed the most to science, that is just a myth.