There are two major problems with the U.S. lack of enforcement of immigration laws, and neither one is terrorism, in my opinion. The U.S. is such a large country that terrorists could probably sneak in even with tightly controlled borders.
The first problem is wage economics. By having too many illegal immigrants here, doing our lawn mowing, babysitting, and other "low end" jobs, wages for unskilled labor are depressed. As a result, uneducated and unskilled American citizens are squeezed out of the low end job market. And what are they supposed to do? Not everyone has the capability to be a software engineer, or even an auto mechanic. Are inexperienced, disabled, recovering, or uneducated folks all supposed to join the Army? Sit on welfare? The excuse that the illegals are doing jobs that Americans "won't do" is dishonest--the truth is, American's won't do dirty, hard jobs for cheap. And the folks in sunny Southern California really like cheap nannies and cheap gardeners.
The second big problem I have with our current policy is more philosophical. Isn't it bad government to have numerous laws on the books, which are not enforced because certain constituencies scream and throw money around? Why can't we have an honest debate, make a decision, and stick to it? Either we enforce illegal immigrant labor laws, or we wipe them off the books. We have a process--why should people who get in the back door get away with it? Selectively enforced laws can be easily abused by the government to punish political enemies unfairly.
I think the answer lies somewhere in the middle, between the lock-down crowd and the open-borders crowd. We should allow a guest worker program to support labor intensive businesses like agriculture, but we should control it carefully to keep wages such that Americans have low-end jobs if they need them. We should build fences where needed to prevent coyotes from smuggling people into the country. And we should come down, hard, on businesses that hire illegal immigrants. Unfortunately, a national I.D. card is a bad idea whose time has come.