We can do both
That almost reminds me of the arguments about not spending money on space when there are problems on earth. We have the resources to do both. Certainly a deep study of the asteroid belt is a worthy and important endeavor.
I'm not sure the extent that Didymos has been analysed but the impact will teach us a lot whatever the composition of that asteroid is. Not just how a hard or soft or in-between asteroid acts on impact but how our targeting spacecraft system works. And of course this is only the first of such experiments in how to deter a wide range of celestial threats.
