If your justification is that regardless of his actions the net result was "good" for the people. You run into an undefended slippery slope.
If we murder everyone in the US, that has deadly communicable diseases, or hereditary genetic disorder and we wipe the diseases out, that's "good" for the people, and the harm when compared to the whole is trivial as long as you kill less than say 30 million people. We can never hold ourselves to this sort of standard and claim we have any form of justice.
On the other hand, the law is far to ridge without the human factor, and hence the jury, a jury can nullify a case if they so choose, and simply agree that this person violated the law, but did it for a reason that his peers felt they deserved no punishment.
I'm not saying that Assange, so go to jail, I'm simply suggesting that he has to have his day in court, if what the state is saying is to be show through evidence to be true, or false. And that if his group of peers feels that after hearing all the specific details of the case from both sides, determine if what he did is right or wrong.