Iran Contra is a good example of what is the problem with the CIA. They believe they are a covert military force and diplomatic wing of government, and NOT an intelligence gathering service. Because of this, after Iran Contra, they just pulled out of everything including the basics of intelligence gathering that would generate actionable intelligence.
The vietnam war murky start was due to it growing out of CIA lead military actions. In many ways a more up front decision decision in government about if there should be any military action in Vietnam could have saved many lives, with either a fully committed profession US force being deployed earlier on or simply not engaging in the conflict at all and coming out at the same result it ended in anyway.
If the CIA concentrated on understanding what is going on in the world and feeding that back to the government. With military actions left to the military, and diplomatic manoeuvring left to the diplomatic corp, the US just wouldn't get into half the messes it does.