Yes, in the perfect world it shouldn't have been the case. But, in the perfect world the Afgans shouldn't have done the following too:
- Not recognizing Pakistan in the UN after her birth. in
- Always preferring India over Pak.
- Claiming a significant part of Pak and actively supporting insurgency in Pak's tribal regions.
- Waging a short war against Pak in '60s.
- Inviting the USSR into their country by becoming God-less communists, which invariably required a stern reaction from Pak for the USSR had already usurped a half of her in 1971 via 100% military, intelligence, economic, diplomatic etc. support to India. The plan was to get the other half. The India launched operation Brasstacks by massing 500K troops across Pak's borders in 1986.
- Failing to form a national synergy after the expulsion of the USSR.
- Becoming a nexus with the Al Qaida.
- Becoming a second fiddle to the RAW/MOSAD/CIA's evil designs against Pak. Result is the unbearable terrorism inside Pakistan.
- After the expulsion of the USA, dialing up the terrorism by many folds via the TTP.
- Etc.
Bottom-line: Either let India fight Pak till the Last Afgan (inside/outside Pak) via terrorism to Pak's total collapse, or chop off the Last Head of the Last Afgan to save Pak from this existential threat. Every action has a reaction.