Again, that's experimentally false. Saudi and Mexico didn't develop their own home-grown spyware. They bought an Israeli product instead. This stuff is harder than you think.
DPRK manages this shit, it's in the reach of any nation-state.
if you're in a precarious political position, a homegrown entity that produces these tools can quickly become a threat; the citizens you train/employ will have their own political ambitions, nationalistic tendencies, empathy for their fellow citizens, etc.
there are most certainly situations where it's safer to just outsource your natsec/tradecraft to an entity that only cares about their bottom line.
Saudi and Mexico don't produce many homegrown weapons systems either. Again, non-proliferation is well-travelled territory. In fact most of these things are not something small governments will have access to if big governments don't give it to them. And treaties restricting trade in these things are known to work.
It's like banning arms sales to countries like Saudi Arabia. All it does is push them towards China or Russia.
Banning this stuff just leads to consolidated power blocs of nasty regimes.