The Taliban takeover of Afghanistan and the involvement of Pakistani forces in that changed the ground situation. Rather than any real change in the security status, this may be the factor that might have resulted in the tour cancellation. The ICC can't do much. They can't even impose a financial penalty, if the teams come up with some proof to show that Pakistan is not safe for them. Look at India. The last time they toured Pakistan was two decades ago. Still, the ICC has supported the stance by BCCI.
@Sithara007 of course ICC won’t touch teams like India and New Zealand, because they earn solid revenues from from those teams. Furthermore you’re right if New Zealand board says their government told them of a threat what were they supposed to do, and even ICC will back them but what’s interesting is how will Pakistan emerge from this ruling.