For a while there, when Beckett was going after Defense Secretary Glenn Morshower, I thought they were going to have Beckett scuttle her CIA career to save Castle and then have to go back to the NYPD. It's actually a little impressive that they didn't go that predictable route.
However, the end showed that the choices made by the CIA sometimes involve letting people get away with crimes for "the greater good," and that didn't sit well with Kate. So I think before long she's going to decide the job requires too many moral compromises and will choose to leave.
Anyway, I should've known who the real killer would turn out to be. On this show, it's almost always the first person they question. At least it feels that way.