Right but I'm not referring to the content the hack revealed, but the hack and release itself. Or is it a ends justify the means situation?
This is a very good question. My opinion on the legal aspect is that neither the hack nor the leak was legal. The hack was clearly illegal because of several laws against it. The latter is a matter of the Office of the President being able to communicate privately with heads of state. This isn't a matter of a dinner with Comey where a terminated federal employee discusses events as a private citizen.
That said, "ends justifies the means" is far more complicated. In cases like these many will approve from their own perspective. The sausage making as it has been referred to is important because if there is rotted dead diseased cat in it then a good case can be made. Likewise if a President is duplicitous, people will want to know because these things are relevant to the future of the nation.
This comes down to an everyday situation, the balance between what is legal and what is "right". The latter in quoted because unlike law the definition of right very much a personal thing and we face a variant of the Trolley Problem. Which "wrong" do we choose, doing nothing, killing one, or killing five? Are any of them even wrong or right?
Break the law and reveal skulduggery, or give difference to the law, or just hope it all goes away and make no decisions at all.
For myself that is not something I can predict in advance. I am glad I know more, however I realize that at some future time the decision to reveal may do serious harm.
But the law or the ends do not in themselves choose an action. It is our own ethical and moral standards and whether we have the strength to make a decision that ultimately actualizes our actions.
I've not given you a direct answer I'm afraid, just an opinion of how I see the choices are made.