The thing is, in total war the military uses all resources—people, money, ideas. Without the World Wars, who knows how technology would've progresses on it's own—since we can't compare it's disingenuous to say it's only because of these wars.
But we know that many different networks were created. The idea we would not have a global network without the internet is false by inspection (FidoNet was global).
The code breaking machinery was not the internet. Besides, the code breaking machinery relied on tubes (and later, transistors) both developed by the free market.