When I was a student an idea was popular in Soviet Union that war moves science.
I think this idea is correct in certain sense. If you include preparation to a war. Yes, some individual scientists were killed in action or in some other way as a result of the war. But on the other hand, if you mean by "war" the military competition in general, is not it clear that governments finance science, physics and mathematics first of all, to preserve their ability to develop top military technologies?
I witnessed a real boom in mathematics and science education, and in financing research both in Soviet Union and in the USA during the Cold war, and have no doubts about the real reasons of this boom. Especially nuclear bombs and space technology convinced the governments and the public that one has to invest in fundamental science and mathematics. (I don't have to explain that the whole enterprise of space exploration is a byproduct of military technology development during the Cold war, and also Internet, by the way, and computers too).
And examples from the earlier epochs in history are also ample and well-known. Governments financed research in Astronomy and Celestial mechanics in 18th century for the needs of navigation, to maintain their colonial empires, Napoleon created the principal French scientific centers, etc. There is no doubt that design of war machines gave jobs to physicists and mathematicians in Hellenistic times (Archimedes, for example).
War by itself is bad, of course. For science and for everything else. But preparation to war always was a powerful engine of development of science.
EDIT. Why this point of view is widespread among the former Soviet mathematicians. Soviet Union was a much more militarized society than Western countries. This partially explains the strength of Soviet mathematics (and physics). In other sciences Soviet Union was much weaker. So one can say that Soviet math/science education was so good, and here so many jobs for mathematicians because Soviet Union was a militarized society. After the launch of the first satellite (a byproduct of development of ballistic missiles), Americans made huge investment to the exact sciences and science education.