The problem here, in my opinion, is the highly subjective nature of "meaning well" and having "good intentions."

Some people might think that vigilantism is good, especially if the perpetrators mean well by dealing 'street justice' to criminals who prey on the innocent. The same could be said of someone who beats a drunk man unconscious to prevent him driving.

There could also theoretically be good intentions behind smuggling, vandalism, theft, and fraud.

However, if everyone simply did what they believed to be good, then the result would eventually be an anarchic, dangerous world. Not everyone has the same beliefs as to what intentions are 'good' enough to mitigate the outcome. While the law will always conflict with what a lot of people might think in relation to individual incidents, it tries to set a universal standard that is reasonably fair to everyone affected.

With regard to most crimes, the intentions of the perpetrator are indeed relevant to whether or not they actually committed a crime - but the 'intention' the courts look at is whether the person intended to carry out the act in question, not what they intended to achieve by doing it. Their underlying motivation might, however, affect their sentence, one way or the other.