I think he was in a tough spot because of the way Republicans have bullied him on the Clinton investigation. I know he is a registered Republican but I don't think he's a hardcore partisan. His first concern is probably his own and the FBI's reputation, which had been unfairly tarnished by Republicans' unprecedented second guessing of the investigation. He was probably concerned that someone within the Bureau, many of whom have it out for Clinton, might leak it and that it would look like a coverup. That would actually have been worse for Hillary.
I think the vague letter Comey wrote and the way he went about it was inappropriate, but writing a letter might have been the least bad course of action if he had given more detail so that it was not open to such wild speculation and exaggeration. His letter should have specified what the additional evidence was, how it was found, and made clear that nobody had even looked at it yet. He could have also made the letter classified, although it still would have had a high risk of being leaked.
I am angry at Comey, but I am far more annoyed at the media for their reckless journalism, blindly reporting Jason Chaffetz's interpretation and instantly declaring it a "bombshell" and "game-changer" before even knowing any of the details. Even now that it's clear that it's not nearly as bad as originally reported and is probably nothing, they are still calling it a bombshell and talking nonstop about whether it will change the election. The media's misleading and sensationalized coverage of the letter is going to have a much greater impact than the actual letter itself, which those who actually read can see is not that big of a deal.
I certainly won't call Comey a man of integrity, but I'm not sure I'd describe him as a partisan hack either.