The framework is a distributed system. It does not operate in a particular location, but instead works by stealing processing power from multiple devices around the world. This why they could not trace it.
What I say below can be considered speculation as it does not have a spoken in lore explanation. Yet I considered an educated guess. In any case, I doubt the writers will revisit how the framework works. All disregarding Darkhold’s handwavium.
Why does it not disappear all at once?
Setting down the distributed system probably means sending a signal to disconnect the devices. This is not an instantaneous process as it depends on each device receiving and acting on the signal independently.
We can argue that the disconnection process should be faster. After all, those devices must stay connected for the simulation to work. There two things I can think of that explain the delay: 1) the signal to disconnect is not – and cannot be – a broadcast※. Instead, each node must rally the signal to its peers before disconnecting. In addition 2) The system was not designed to be disconnected. In other words, disconnecting nodes is not part of the functions needed to keep the simulation running. The opposite is true; the system should be resilient to attempts to stop it. Therefore, we assume that for the disconnection signal to work there are some unspecified hurdles to hop that take an unspecified amount of time.
※: Assuming there are devices connected in multiple logical networks by tunneling through NATs, proxies, firewalls, etc. A simple network broadcast will not reach them.
The disconnection of a device would cause any objects that the device was responsible for to be unavailable from the rest of the network. The result is they disappear from the point of view of the network. They will effectively cease to exist as the devices release the computational resources used in the simulation.
What was the motivation?
We need to remember that Aida was no longer a cold calculating gynoid. With emotions being new to her, she was acting more on impulse than on logic.
We get a hint when Radcliffe said
Look, Aida is shutting down the framework. It is collapsing on itself. This is what happen when you piss off your creator.
Suggesting that this is an act of anger.
Was Aida trying to get revenge on S.H.I.E.L.D. by killing Mack or perhaps also Elena?
It is in her interest, as she expressed, make everybody in S.H.I.E.L.D. suffer. She didn't express any interest in killing Mack, in fact, she saved him. I do not think this is the main motivation, yet making people from S.H.I.E.L.D. suffer is a good plus.
For Elena, It is a similar case as that for Mack. We do not have reason to believe Aida was aware that Elena entered the framework... yet; killing Mack would make her suffer.
Was she simply destroying the Framework because it was no longer of use to her?
Very likely. There is also a chance that she despises it, since she said she was a slave there. This goes in line with Radcliffe remarks.
Did the Framework just sort of “fall apart” because of her absence, or because of damage to the Superior’s base?
As I said earlier the framework as stablished as a distributed system.
Or something else?
I did consider that perhaps she wanted to create a new framework to go. As we have seen, it is possible to survive in the framework after you die in the real world. I have nothing to support this hypothesis.
For abstract. The most likely motivation for Aida is not simply that she did not need the framework anymore, but that she hated it.