This is not to say that we can do a perfect job, but we can do a better job. The presence of police on our streets does not prevent crime, but crime would be worse without our police on the streets
The primary purpose of government is to secure our safety. All else hinges on that. Commerce, entertainment, art, education etc. cannot take place without people feeling secure enough to interact with one another. The costs of a future attack to the economy and the rest of our way of life will far overshadow the transaction costs and other problems associated with increased border enforcement
If you want to play statistical games, fine. We'll play statistical games. In probability theory an action should be taken if the expected value of the outcome is greater than another outcome. Or if you want to use the inverted logic, an action is a greater threat if the expected cost is greater than the expected cost of another action.
The expected cost is obtained by multiplying the probability of an action by the cost it would impose. Now, what do you think the chances are that the next attack on the United States would come from someone entering the border illegally? Furthermore, what do you think the costs would be in terms of lives?
However, all of this is academic. We should go after both sources of immigration that pose threats to our nation, illegal and legal.
We should do so to the best of our ability, knowing that no system is perfect. To do less would stand us in poor light when viewed by future generations