There are basically 3 ways to invest your Hacking operations:
Fill systems with sleepers in order to get the higher levels of operations.
Establish a network of backdoors to hack distant systems. Especially the enemy's capital.
Hack neutrals and pirates to improve relationships.
Hack allies to remove backdoors and sanctuaries.
There are basically 4 ways to invest your bandwidth:
Defend 3-7 of your systems against hacking.
Accelerate hacking operations.
Cause overloads for defensive programs.
Most players usually attempt hacking the nearbiest enemy systems. Find a defensive program and give up, then just spend hacking in neutrals.
However, the AI and most players don't usually expect dangerous hacks to come from Pirates or Neutrals, nor do they expect to have relatively distant systems to get hacked. And the advantage you can get from these, such as Supporting Rebels, which can spawn fleets in all their systems, can be amazing. And that means that even if it takes more time you should try hacking these. Moreover, due to its nature, hacking is really good against Cravers and other "wide strategies" because they have far more systems than ability to protect them with defensive programs.
I am not saying that hacking is as fun as the main game (except for the Choir, where it is basically the main game) but 10
Also, most allies change your priorities when you see them. Like, if you see Vodyani or Cravers spawn near you, you immediately should prepare to make defensive fleets, and defensive programs are not the only way to respond to the choir. If you make an alliance with them you basically get a free constellation to settle with all resoures included, even if it ends up somewhat subpar due to sharing your planets.