I dont think “the CIA”, as an organization, killed Kennedy. I’m sure 99.9% of CIA agents had no pre knowledge of the assassination. It is more likely ex-CIA head Allen Dulles (who was essentially running a parallel CIA after being fired by Kennedy) lead a small team of CIA members loyal to him in the murder, and also included Hoover and LBJ in the plot. All of these men hated Kennedys less aggressive and less militaristic foreign policy. (I recommend a book called “The Devils Chessboard” to learn more about this)
Of course, many more members of the CIA were complicit after the fact in not revealing truths about the assassination.