You can't force people to make the right choices through legislation. There will always be loopholes and technicalities, and a law system that attempted to do so would be so restrictive of individual freedoms as to be entirely impractical.
If a society stops being composed primarily of good people that make the right choices for the right reasons, that society will crumble, and no amount of legislation will save it.
If a society stops being composed primarily of good people that make the right choices for the right reasons, that society will crumble, and no amount of legislation will save it.