If we were talking about budgeting money to detect an asteroid in the first place, the analogy would be spot on. And indeed, we do suck at detection, its a tragedy of the commons, its difficult to align on, all those things you mention. Because its abstract.
But, IMO, there is a huge psychological difference between trying to sell the public on detecting an asteroid, vs diverting one we know is coming. The one you know is coming is this concrete physical threat.
This is very easy to sell. At a visceral level, almost everyone has been hit by a rock. Once you believe NASA telling you its coming - and I bet policy makers will believe that piece - the rest sells itself.
This is the difference between getting someone to pay money for health insurance, vs getting them to pay to remove a tumor. The former is a much harder conversation than the latter, though they are functionally the same.
Climate change involves explaining the impact of potential changes to a complex system.
There have been very many action movies about asteroid deflection. Its simple, its dramatic, its sudden. Its like the moon landing. Climate change is this slow creeping abstract thing, and that honestly matters hugely in terms of human factors.
So what you're saying is, this optimistic scenario where everyone pitches in to do the rational-but-expensive thing to save themselves is less like an imminent car crash that's unavoidably about to occur because an oncoming car has swerved into our lane, and more like... the steps we'd need to take to avoid drastic climate change?
That's the scenario where you don't believe we'd fail to do the right thing?