There are three reasons why the FBI and the CIA didn't figure out that the September 11 attacks were coming. First, everyone was concentrating on what was seen as more likely chemical or biological attacks. Terrorists had already used these weapons, or were known to be trying to get them. The FBI deals with a lot of really paranoid people and big time conspiracy theorists. Thousands of bits of information on new threats arrive each week, and most are viewed in terms of the major threats the FBI believes are out there. Which wild potential threat is really true? Even after 911, they still have to deal with that. Second, the Islamic terrorists that had been arrested so far, especially the two groups in New York City in the 1990s, had not been an impressive bunch. These terrorists were determined, but had to receive technical assistance from al Qaeda specialists. The specialists always left the scene and escaped before the attack took place. Some of these al Qaeda hotshots were captured and they didn't appear suicidal. So it was assumed that the biggest danger was al Qaeda specialists traveling around helping local groups to carry out whatever attacks the locals were willing to undertake. It was not thought that al Qaeda would sacrifice their hotshot specialists in suicide missions. When it was discovered that al Qaeda members were taking flying lessons, everyone thought that this was for a chemical or biological war attack. In other words, the FBI and CIA were fitting all the evidence they got into their theory of how al Qaeda operated. Despite the growth of suicide attacks among Islamic terrorists since the 1980s, it was assumed that al Qaeda was not going that way big time.
The CIA's role in all this is advisory, as the FBI is responsible for internal security and law enforcement within the United States. The CIA is an intelligence agency that can only operate outside America. While cooperation between the CIA and FBI has gotten better in the last decade, it is still not perfect. The FBI has 12,000 agents (7,000 of which are now working on terrorism cases), but few have training in intelligence collection and interpretation. The FBI investigates crimes, the CIA analyses intelligence information. Moreover, the CIA is constantly struggling with the other intelligence organizations it is supposed to coordinate (only 17,000 of America's 80,000 intelligence staff work for the CIA, the rest are in the Department of Defense.) Increasingly the CIA is seeing the FBI as another rival in the intelligence business, with over 40 FBI overseas offices fueling those CIA fears.
Lastly, we have to face the fact that the FBI has lost it's leadership edge due to the recruiting slump they went through in the 1960s and 70s. This was another ignored aftereffect of the Vietnam war and Watergate. The 60's generation was turned off on the FBI and the feds had to take what they could get. The growing number of leadership failures in the FBI can be traced to this. With really excellent leadership, someone in the FBI might have connected the dots and figured out what al Qaeda was up to before September 11, 2001. Hindsight is easy, foresight is hard.