If you dont know something is against the law and you do it with a clear conscience then i dont think you SHOULD be punished but i see why you would have to be punished. If ignorance of the law was an excuse to commit a crime then everybody would be using the ignorance card. That doesnt mean you should be punished. Lots of things that should be cant be because of the idiots who will abuse the freedom that we deserve.
If it is something that is obvious such as theft and murder then yes ignorance is no excuse (i doubt there would be cases of such anyway)
But like Astal3 said, you may not know about a speed limit.
Or perhaps what is considered crime in some places is not the same in other places. We cannot memorize every single law of every single country now can we?
A good example would be speeding. If you do not know the limit how could you possibly follow the law? As long as you are going a resonable speed you are not endangering anyone. But if you peel down a side road at 100mph your endangering everyone. But on the other hand the more serious the crime the less ignorance is a valid excuse. It should becommon sense that killing someone is wrong and ignorance cannot apply
There are decisions on which we all must put sentimental pulling aside.
To decide upon the correct choice, we must take an utilitarian approach to the issue.
For example, speeding in a car is a common example of breaking the law. Perhaps the violator did not know the limit. Maybe he/she did not see the sign due to limited vision.
However, would you consider that an excuse for speeding?
Because of the speeder's flagrant judgement, the safety of others had been endangered. Here, we must take a disinterested view and fine the driver as needed.
The same train of thought teaches us that ignorance of the law is NO EXCUSE for breaking it.
Even if people don't know the law they should be trying not to break it. Imagine that you are a police officer and you see someone murdering someone else. If the person who killed the other guy says 'oh i didn't know that was illegal' what are you going to do? You are OBVIOUSLY going to take them to court