Legislation and enforcement
People here are talking about crimes and fines.
This requires both legislation and effective enforcement.
This, of course, costs money.
Let's take the dubious comparison with Civil Engineering. There are vast bureaucracies to set the rules, inspect, and enforce. Because the human cost of the collapse of a tower block or a railway bridge over a river is potentially enormous and tragic.
For less critical projects such as building and extending small domestic properties there is Building Control at the local council.
For building a small patio there is no regulation because the risk does not justify the formation of the Patio Police.
So this model might be roughly applied to coding.
Complex and rigid code and deployment safety requirements requiring certification before deployment for large commercial deployments.
Lighter touch control for smaller business platforms.
All of this will cost time and money and the careers of all in GDS, Steve Bong, and anyone else who loves anything with the word "agile" associated with it. Fair enough - fail early fail often doesn't fit comfortably with building suspension bridges.
A line has to be drawn somewhere.
Most "free" software has rapid development and low overheads. The Raspberry Pi is being pushed to encourage people to write (and presumably share) code. Requiring a full security audit before you can post your 50 lines of code online is obviously not practical.
So - people can post free stuff without warranty because it is free.
Malicious code should incurr penalties (but that is in current legislation).
App stores should be held responsible for all the code they publish.
However all this will requie a global Inspectorate to prevent shonky software just moving offshore.
Quick and dirty software will become less easy to deploy to seed a business - Twitter and Facebook anyone?
All this will cost an enormous amount of money to set up and police, which means that the general public has to be really hurting before they will agree to fund it. So far all I see seeis minor irritation.