From what we know of the "Hive mind," every drone, ship, and mind are all interconnected; each mind has the who Hive in their head. So when Data connected to Picard and his link to the Hive mind, how did he amazingly find and access the control of that particular ship? I just don't see how he did it so quickly or easily.
A wise command structure does not apply commands globally by default, but locally. (And this, alone, is likely the answer.)
Sometimes commands can have default settings. For instance, in Unix, the command "rm *" applies to the current directory, not to every directory on the drive. It also doesn't descend into subdirectories unless you tell it to.
There would be propagation delays. There was one cube in the Alpha Quadrant (or one that we know of -- maybe there were a couple back-up ones that got blown up without our knowledge). The others were far away, so the command would have taken time to reach them.
With any networking system, it's prudent to not always trust something just because it came from another node without verifying it. Think of it in today's terms: Something might come into your LAN from another LAN that you trust, but it's still possible it was from malware, so it's still wise to scan it for issues. Other cubes, or the collective as a whole, probably scans incoming communications from members to be sure they're valid and free of malware.
Think of how vulnerable the Borg would be if a command like "sleep" were to work on the entire collective at once. Such a command, like many others, would work only on a local level by default. (Or, as a safety, it could be that such commands would never work globally and would have to be activated on each individual ship separately.)
The question is, more likely, why it didn't effect Locutus' subgroup (or unimatrix, or whatever the proper term is) only. But since Data was gaining access to the command structure, it is very likely that along with finding the commands, he was also able to find out how to pass parameters with it, such as, "sleep --range=cube."
Locutus was not an ordinary drone. Picard was an unusually capable and intelligent human being who was made into a speaker for the Borg, an ambassador who may have had unusually direct links to the high-level command and decision spaces. The contingency of such a drone being captured and probed by a powerful cybernetic brain, while in close proximity to its cube, is one the Borg might never have encountered before.
So it worked; the cube went dormant for a few seconds, then exploded (probably as a defensive reaction to prevent the spread of the effect). It would probably not work a second time.
Do not forget that the Borg tend not to investigate as much as they do adapt. If they had never been attacked this way they might not have much of a defence against it, apart from other defences which might overlap the functionality.
Data was an anomaly and managed to find a unique attack upon the Borg which they had never come across before and hence was able to exploit it. Quite possibly if he tried it again he would find the door locked, bolted, barred and electrified.