I've been reading Ultimate Sacrifice, a book that links the assassination of John F. Kennedy, the Central Intelligence Agency, and organized crime (aka the Mafia). I'm not very far into it so can't comment much on the book itself, although it does seem like the authors spend a lot of time hashing over minutiae and don't seem to have much of a clue in terms of following a coherent narrative line. One thing is super clear, though, and that's how useless the CIA was back then.
It's unreal. The CIA apparently had a gazillion people working for them -- their "station" in Miami apparently employed 3,000 people. You read that right. Three thousand! They're in the heart of the Cuban exile community. And guess what? They can't obtain any reliable intelligence from Cuba. They keep trying to plant spies, deep cover agents, inside Cuba and failing. Their would-be spies end up arrested or dead. But does that deter them from plowing ahead with plans to assassinate Castro? Nope. Apparently the CIA higher-ups had the same attitude as the cockroach general in the Fabulous Furry Freak Brothers comics: doesn't matter how many foot soldiers get squashed, there'll always be replacements.
And why is the Castro government so good at catching CIA spies? Because the CIA had already managed to build a nasty reputation for meddling and murder in Latin America, thanks to activities like engineering the overthrow of the democratically elected Guatemalan government a few years earlier. The CIA trained assassins to target Guatemalan officials and activists. Castro knew what the U.S. government in the form of the CIA was capable of and prepared accordingly.
Guatemala was, of course, a pattern the CIA followed for years, usually with disastrous results for way too many people. Name a decade and you can find a CIA operation that turned out to be a Colossal Blunder. In the 1970s they helped engineer the overthrow of the democratically elected government of Chile, which led to years of oppression of the Chilean people by a murderous dictatorship. In the 1980s they supported Bin Ladn and helped create the Taliban in Afghanistan.
What's even more bizarre is that a good deal of the time they were actually working at cross-purposes with the rest of the government. The State Department would be pursuing one option through diplomacy while the CIA was busily doing the exact opposite with its covert operations. They would deliberately undermine the diplomats.
And then when you add in the fact that most of the time the "intelligence" they were supposedly gathering turned out to be wrong. . . Why does that agency still exist?