It's very obvious what happened here with Comey.
Comey is a republican, He was investigating Clinton and he pretty quickly figured out that there wasn't enough to charge her with BUT he also knew that the increasingly irrational Republican party was counting on him to finally kill the Clinton boogeyman that's been haunting them for 40 years.
So he figured, "I can't really indict her but what I CAN do, is drag this **** out, and then give a highly inappropriate speech; a hot 16 excoriating Clinton with enough bars so that my Republican bros can cut some attack ads"
"that should satisfy them right??"
WRONG: republicans freaked out, dragged him up to congress, and started ******** on him to the press and he's thinking "WTF man, I was trying to help you guys."
He getting dirty looks at dinner parties, and the entire FBI, which is mostly filled with republicans, are also mad at him, so he starts pannicking. "I gotta be able to show up at the Koch brothers blood orgy when mercury is retrograde, I have to fix this"
Then he gets the Weiner news... and says, "OKAY, new plan, lemme just drop this vague letter, with zero context or explination, this should cause max damage to Clinton and help get back into Republican good graces."
and here we are.