One of the biggest deterrents to committing a crime is the certainty of getting caught.
Maybe for you, personally, but not for a genuine terrorist.
Saying that domestic spying deters someone with a deep hatred of a country from committing an act of terrorism is like saying that gun laws reduce gang violence.
There is just no way to deter the will of sufficiently motivated person or group of people.