It would be wrong if Comey withhold the information about Hilary's investigation because by not revealing the truth Comey is using the public as means, tool to achieve a political vote in favor of Hilary. Thus, morally wrong.
It would be wrong if Comey withhold the information about the investigation because if everyone starts to withhold information and lie to the public there won't be any information transparency. This will lead to people taking advantage of it for their own personal interests. Thus, morally wrong.