A propos of reports that a terror attack against the U.S. Embassy in Azerbaijan was recently thwarted, William Langewiesche's revealing (and somber) piece in this month's Vanity Fair offers some insights into why embassies are security disasters:

in June 1985 [a State Department] panel issued a report that called predictably for the wholesale and radical fortification of roughly half of the 262 U.S. diplomatic facilities overseas. Modest security improvements were already being made, with the shatterproofing of windows and the sealing of doors, as well as the installation of steel fences, potted-plant vehicle barricades, surveillance cameras, and checkpoints in embassy lobbies.

The intent was good, but the program was hardly effective: American foreign service employees continued to be killed. Colin Powell made another attempt to fortify embassies in 2001, but, as Langewiesche points out,

For whatever reasons, the United States has come to the stage where it maintains 12,000 foreign-service officers at diplomatic posts abroad. There is no question that these people are targets, and no evidence that reforms in foreign policy will make them safe enough in the near future. As long as the United States insists on their presence, the State Department has no choice but to protect them. The new fortifications are not a perfect solution, particularly since there will always be the next softer target—whether American or allied....

The United States has worldwide interests, and needs the tools to pursue them, but in a wild and wired 21st century the static diplomatic embassy, a product of the distant past, is no longer of much use.

--Keelin McDonell