Laws can't be enforced 100% of the time because many laws require intent, which is unknowable. You have to make an educated guess behind it. Even if someone tells you their intent, straight up, you still don't know their intent. You just know what they want you to think their intent is, which may or may not be the same thing. It's legitimately unknowable.
Ideally, for a lot of things we want to punish people who knowingly do bad stuff, not people who do bad stuff because they thought it was good.