In the 80s, Pakistan enjoyed lavish CIA funding (to train Talibans to topple the USSR in Afghanistan). Publically, the Pakistani regime could thus put on a show that they were the "Stalwarts" of Islam.
It worked well for Pakistan when the U$ and Talibani elements were united to combat Socialism (mainly SOcialist Afghanistan but also India- who supported Socialism then).
Now that the Talibans and the US are enemies, Pakistan is forced to choose sides. Domestically, they can't abandon the Wahabi elements and internationally, they need the U$. What will they do?
People like M.A Jinnah and Zia Ul Haq should've thought this through instead of indulging in petty opportunism...