The best way to prevent this is to use "counter espionage" missions against the civ that is sending spies against you. This multiplies the cost of espionage missions by a huge factor, something like 10. Of course another thing you can do as well is to bump the espionage slider up towards the end of the game, but really, the single most effective thing is the counter espionage missions. It's a pain to have to do it every 10 (or is it 20) turns, but it really puts a stop to spies blowing up spaceship parts.