As I was sitting in my car, at a red light, it occurred to me how important rules are in our lives. My car was boxed in on all four sides. Thus I was unable to move it. But the car in front of mine was at the start of the line, it could move freely forward if the driver so wanted. Why didn't s/he, then? Well, because the traffic light was red. This wasn't a physical limitation, but rather a mental one. We are taught that we should stop at red lights (in many parts of the world, this rule may be optional :->), and not stopping is considered "wrong".
I think that this sense of right and wrong is a the single most important reason why people follow the rules, or abide by laws. So a law that is considered inmoral will probably be broken by a lot of people. To prevent that a Police force would need to play a strongly coercitive role. I guess this is the reason most people followed a lot of the rules in Police States such as the Soviet Union.
Aside from inmoral laws, some laws are considered plainly unfair (taxes?). Maybe people won't violate them outright, due to the influence of the police, but they will be broken "underground". This reminds me of the 18th amendment to the US Constitution, popularly called Prohibition. It seems that the current Prohibition is the anti-drug laws, which barely dent the drug trade through-out the world. I am not personally in favor of decriminalizing drug sale or use. However, it seems that it shouldn't be an interdiction nor a law enforcement issue only: it is a cultural issue as well; if not, then it surprises me to find characters in TV series or movies coming from the US, for whom prohibited substance use and abuse is so commonplace as to seem almost trivial. It is this culture that makes some penalties seem unfair.
If an outlawed behaviour is unpunishable, either due to official tolerance despite the letter of the law, official incompetence, or official consipracy or corruption, then it will also be systematically violated. So for example, in Mexican highways most people drive above the posted speed limit -sometimes, very much so; when one is stopped by the highway police, it almost seems unfair. This is because, despite any written documents, custom and tradition are more powerful by far.