I'm not a fan of war, but many technologies and sciences were developed for military use, everything from mathematics for ballistics, food preservation, thermodynamics, antibiotics, nuclear energy, the lunar program, and GPS.
So yes, war is a horrendous waste and terrible detriment to humanity, but even war has had some beneficial side effects.
The same effort can be put into inventing these in the absence of conflict. You do need funding and you do need urgency, but that's a question of national will.
So yes, war is a horrendous waste and terrible detriment to humanity, but even war has had some beneficial side effects.