In Israel the rocket attacks are a large motivation for collaboration between the military / tech sector and there's plenty of startups that actually focus on providing services around this, there's an app for example that warns people when some rocket attack is supposed to happen.
What you're identifying as cost here is actually a service that a business can provide. The close military connections (also supported by the conscription) are actually an asset for the country in terms of technological progress. Think of it like a messy version of the cold war.