It's the law in our township that you have to pick up your dog's poop...plus this is a residential area and a few years ago they also implemented a "leash law" so you can't just let your dog run around like the good old days when I moved here...no leash laws, no street lights, no stupid new neighbors
...ahhhh the good old days.
Right in my immediate neighborhood, a seemingly even more important/effective factor is the social pressure from all the neighbors. If you're noticed not doing the right thing, you will hear about it.