The DestroyBaghdad method is a pretty clear-cut case of code doing bad things. But what about more subtle cases of “software development malpractice?”
I think this comes back to the whole “professionalisation of IT” idea that’s been making the rounds for a half-century. I’m a member of the Canadian Information Processing Society (www.cips.ca), which tries to regulate that problem similar to how engineers, doctors and lawyers do it. They’ve got a professional body of knowledge, a code of ethics, certification for university and college programs and legislated rights to a designation in many jurisdictions.
Personally, I like the idea of going to jail if my code kills people or causes significant loss or I act unethically/unprofessionally and someone is harmed by my work. I really think that what we do is important enough to society that society mandates that we do it well.