While the need to have some sort of intelligence gathering apparatus is very well defined, balancing this need with the Constitution in the post-Cold War period is not easy. With the extremes of no security and too much spying, the end results can often be abuses of power or failures to identify threats. The PATRIOT Act, in its original iteration, was supposedly designed to corral these potential abuses, forcing a court order and periodic Congressional approval for data gathering. Instead, the measure has been perverted to justify any effort, so long as a court order, done in secret, is attached.
Of course, plenty of critics feared at the time that the Patriot Act would lead to exactly these kinds of abuses. Here’s a handy 2003 roundup of the criticisms and lawsuits that the legislation had already attracted less than two years after passage.