Recognition and trade of states with enmity was present from the inception of Islam all the way to the Ottoman Caliphate.
This trend of isolation is a result of muslim insecurities after losing most of their status as leaders of world powers. Pakistan is befuddled with the legacy of the Khilafat movement and Arab -Israeli conflict. Oddly, those countries that have had actual conflicts with Israel now not only recognize but train with them, and are consequently much more able to influence the rights of Palestinians - while Pakistan simply suffers from thinking itself as the next Bani Israel so the only one responsible for maintaining some romantic principle.
But that is a larger issue of an ignorant population and less of state direction.