And as the US discovers very quickly, it happened due to intentional inefficiencies and silo-ization of intelligence.
No, that is not why it happened but framing it that way is seductively authoritarian and one of the main reasons for the creation of the modern surveillance state. Having spent billions to stop more attacks, what do we have to show for it? The Boston bombers plus a whole host of "white" attacks like mass shootings and the NSA's official record of having stopped precisely zero attacks on USA soil.
The reason these things happen is because the real world is an immensely complex system
Yes, the real world IS an immensely complex system, and terrorism will always be a part of life. And inevitably, some terrorist acts will be committed BECAUSE of the invasive and overbearing 'security' appartus we've allowed to be built because we foolishly think it's going to make us safer.
That said, what about taking responsibility for our own contributions to the mess we're in? If we build a society that actively promotes increasing poverty, inequality, disenfranchisement, and personal powerlessness, then we're building a society in which some of our members will respond senselessly and violently. And when we poke our noses into other countries' business, overthrowing their governments, propping up their dictators, and forcing our culture and our standards down their throats, we should expect some serious blowback. Yes, it may be necessary to get the bastards who broke into our house and fucked with our family - but at some point, shouldn't we ask why they're so pissed with us that they'll sacrifice their lives in order to fly planes into tall buildings and kill us? And shouldn't we consider conducting ourselves and our international affairs with more integrity, and with less arrogance and greed?
Terrorism will probably never be elimintated; but honestly, a lot of what we label 'terrorism' is retribution that we've brought upon ourselves, and it looks very much like what we would do, (and have done), if the roles were reversed.