At the time that did reek of corruption and misuse of power, but given current state of things, it was the right move.
It's clear that he was correct that Trump was going to target his political enemies, but it sounds like he can't win here -- if he pardons everyone including Comey, people would say he's abusing the power by pardoning everyone. If he only pardons a few then he's accused of leaving others "high and dry."