It might be true that we can create nukes which have minimal fallout and minimum impact area (I have no idea to be honest), but this ignores the broader consequences such a strategy would bring. Namely that you remove the taboo of using nukes and start to normalize it. It then becomes more justifiable for other countries to also use nuclear weapons, at which point escalation becomes ever more likely. Imagine the consequences if Russia were to use nuclear weapons in its war in Ukraine. Frankly we need as large a stigma as humanly possible on the use of these weapons.
If we had nuked Afghanistan we (probably) would have kicked off WWIII.
If we had done nothing further attacks may have occurred.
Both of those seem at least worse than what actually happened.