I disagree with your analogy, on the grounds of human factors.
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.