Many laws are much like the caution and warning stickers on the products we use. They exist to keep stupid people safe from harm. In my line of work, I get to meet most of the stupid people in my area... sometimes I get to meet the very stupid people over and over again.
I don't know what the intent of the law makers was when they wrote the law about not leaving your engine running, however I do have a couple of GOOD things about the law.
1) Saves alot of vehicles from being stolen, which in turn keeps insurance rates down.
2) Gives cops a reason to write a ticket or arrest drug dealers or other scum when we can't figure out what they are really up to - but we know it is something illegal.
OK, so one of the above is just a joke, but since there are too many people out there that can't judge for themselves when it is safe or not to do this, I guess we have to protect them from themselves.