How come when we hear about this stuff it is always Israeli companies involved? Is ethics not taught in Israeli Computer Science curricula? Those who wrote this exploit are clearly "brilliant" and at least some of them are bound to be reading Hacker News. Is other countries' spyware firms just better at hiding their malware than Israel's is?
Everyone seems to be focusing on the "always" in your statement, so i'll ignore that and give you a straight answer.
Strong investment in STEM education, after school programming and computer security programs, mandatory military service where they get a chance to evaluate everyone and funnel the smart technical folks in to Unit 8200, and heavy investment into security startups.
Israel also benefits from everyone else depending on their tools. Not only do they get to see the intelligence being collected by other countries and gain insights into their espionage operations, they also would be able to piggy back into any networks that were of particular interest.