There is no legal standard or law that justify crime but I think crime can be justifiable in some cases. A criminal offense may be justified if it in some way benefits society or upholds some norms and principles that society may value. For instance, assault could be fully justifiable if it's on the ground of self defense. It is a fundamental value of society that everyone has a right and the obligation for self defence if they come under attack, and so this behavior is in many situations justified
We should note that our rights end where the rights of others begin, so we should also respect the fundamental rights of others. Self-defense is not a criminal offense, but the problem will be the ability of the person to convince law enforcement agencies or the law court that you acted in self-defense. Don't also be deceived many people have used the concept of self-defense to murder people, hence we should be able to distinguish between willful attack and defending oneself. The concept of self-defense is widely used in countries where firearms are legal but in my country, this concept is not popular because owning a gun is highly prohibited.
Let's say someone hacked the bank account of a corrupted politician or government official and donated the money to charity, would you see it as an act of good deed or a crime?
Depends on which side of the issue you approach it from. From a legal point of view, it is a crime, even if it was committed with good intentions. And if from a moral point of view, then such an act can be considered noble. But, unfortunately, the concept of "noble" is absent in the legislation.
Exactly, that is my point. Laws or legal systems don't care about the intention behind an act they have set of rules and if it's crossed then the person is guilty and if it's not then he can be free and justice comes with an expensive price tag in most of world, if you find a very good defense attorney then you can break almost any charges and be free with some penalty alone.
In most developing nations justice is for sale and the highest bidder will get a favorable judgment. In some cases even when a person acted in self-defense and it is even clear to all, but because the perceived guilty person has the financial backing to bribe the judges, he would be favored by the court. In such countries like mine, justice is only for the rich.