I don't think it has to be either spending money on defence or on social system. Sweden and Finland for example managed both.
What many of us European countries did, is that we became too unconcerned about the possibility of an armed conflict in Europe. We thought that war was something that happened in the past or that happens on other continents, because we (the western society) have evolved past the mentality of imperialism and colonialism. And we didn't count on some other country attacking one of us. Russia's actions in 2014 in Ukraine, or even before that, in 2008 in Georgia should have been a warning, but as we can see now, the reaction of Europe as a whole has been insufficient. Maybe the approach that wars are now fought by economic sanctions could have worked if much stronger sanctions have been imposed back then, who knows. But there still should have been more talk about a common defence strategy.
Yes, it wold probably be unpopular. If you asked me a year ago about an increase for military budget, I would have asked, why on Earth would we need it, now I would vote for it in a second, it's simply a different World now. And I'm sure many other people are like that, so yes, it could have been a hard sell for the voters. But since we now hear that many politicians had intelligence about russian plans long ago, it brings a new light into the situation.
Many of us feel safe because of NATO, but that could also be a problem, because, let's be honest, reliance on NATO is mostly reliance on USA and with Trump in office, that was a huge risk. With the real possibility that he could come back, we should, I think, at least talk about a common EU army, if only for the possibility that president Trump in 2025 wakes up one day and decides to pull out of NATO for real.