Dan Ariely's recent book titled "Dishonesty" presents a lot of research that supports this. His thesis (in part) is that people tend to cheat / lie right up until the point they can no longer internally think of themselves as decent people.
In this interpretation, the legal system is a reasonably objective proxy to inform people how far they are across the line. This suggests that even unenforced laws can help establish an acceptable norm, so people have an external comparison.