The CIA is an "ends justify means" organization. And I don't think the ends for them are anything other than "the good of the country" (whatever that means to them at the time). The shady (sometimes downright horrific) things they have done in the past have fit in with that idea. Within that framework, I don't think that they would make these allegations without either good reason to be worried about interference or good reason to be worried about Trump's ties to Russia.
Also, Bay of Pigs was far from an invasion. We didn't even send in air support!