Very intelligent point but how could you expect a CIA subsidury to work for Pakistan and not be a threat to the national security of Pakistan?
Difference is that CIA and Mossad served their countries well, regardless of what they did to other people in world. ISI, on the other hand, had some of its policies which turned out to be a national security threat to Pakistan itself. For example, creation and support of Taliban, IJI.