That's exactly how it works. The law does not exist in isolation as an axiomatic rule. The intent and circumstances of an action are all taken into account. Legalism is tyranny, plain and simple.
Also, you are allowed to say "Yeah, he broke the law, but we don't give a fuck." It's called jury nullification.
As soon as you excuse the law because it doesn't "feel" right, you walk a shaky path to anarchy.
The United States hasn't been walking to the path of anarchy, but quite the opposite. We actually need more anarchy.