Brother , you are so wise and so innocent at the same time.
When GHQ was doing "dirty work" for Americans, did the collateral damage suffered by Pakistan, a major non-NATO ally, harm America in any way ? So, why do you think any damage to Afghanistan while the Taliban does dirty work for India will harm India in any way ?
This analogy you draw does not take into account the relevant context - the mentalities of the different parties.
Indeed, a bit of psychological analysis is necessary to understand the difference.
You are comparing a highly professional, resilient, and secretive military organisation (US Army) with the ragtag and immature Indian nation, whose 1.5 billion inhabitants are still crying over history from centuries ago, never mind what happens today?
It is no surprise that USA is resilient to harm done to its allies. This is their nature and has been since WW2 - they keep going, despite setbacks....
whereas India will even
publicly cry when it loses perceived allies!
Have you forgotten how Indian media, civilian groups AND politicians all cried together in June because "nobody stood with us saar" in the May conflict? This is a reflection of a deep seated nationalised inferiority complex - that panic sets in when other parties are perceived to "abandon" them.
Granted, it is not a substantial phenomenon, and probably only has a minor impact, but it definitely has an impact on the Indian war psyche. It follows that if Pakistan either defeats India's supposed friends or turns them politically, that Delhi becomes reactionary.
Let me now turn your analogy in on itself.
Is USA worried in the slightest about KSA's defensive alliance with Pakistan? No. USA will keep doing what USA does with regards to its interests.
Meanwhile, Hindustan is in full public damage control regarding this development. The public perception (it doesn't matter whether that perception is true or not) is that KSA may now turn against Indian interests and a lot of damage control and reassurance is needed from India's leaders to mitigate this perception, which will occupy a number of their resources to a degree.