To slightly expand on that, there's also a rather well-known(?) quote by English mathematician G.H. Hardy, written in A Mathematician's Apology in 1940:
A science is said to be useful if its development tends to accentuate the existing inequalities in the distribution of wealth, or more directly promotes the destruction of human life.
(Ironically, two of the theories which he claimed had no wartime use - number theory and relativity - were used to break Enigma encryption and develop nuclear weapons, respectively.)
Expanding further, Pavel has noted on Bluesky that Russia's mathematical prowess was a consequence of the artillery corps requiring it for trajectory calculations.