If a country becomes vulnerable because it under-invested in defense , all the schools and hospitals in the world won’t matter.
For developed nations, there is some difference here I think. Yes, security is necessary, but there are ways to have that collectively, without relying on a single country. That is in itself a massive risk. The EU should have enough defence collectively to defend itself and others, but it does not. Time to change that. It is far cheaper to do it collectively in that way as a defence mechanism, and use the extra to build wellbeing, than to do what is currently happening and edging further toward relying on a dictatorship.