That episode of Star Trek: TNG, Justice comes to mind here. The one where they went to the paradise planet and Wesley fell into the flower beds playing with the other kids and they didn't know that it was "illegal". The only punishment they had for any crime was death. They refused to take into account the circumstances of the event, only considering that a law was broken.
"Jean-Luc Picard: I don't know how to communicate this, or even if it is possible, but the question of justice has concerned me greatly of late and I say to any creature who may be listening, there can be no justice so long as laws are absolute. Even life itself is an exercise in exceptions.
William Riker: When has justice ever been as simple as a rule book?"