But that's a good thing to expose too. Might even provide a deterrent to those that are in the habit of producing bad and over-engineered work as it'll be public and potentially affect their reputation. And even then, we can probably still use that code and learn from it. Just because bad code is written with public money doesn't mean it should be kept private.
I think the message should be that the business process also needs to adapt to the needs of a computer system.
I work at a public institution. Our department is paid by many other institutions around the country (networks). Our code is scary and terrifying. It's 95% perl5. We run bare metal on nearly everything. We have only the barest notions of a testbed.
Put it this way: if we were required to release our code, nobody would use our services. Frankly, I'm surprised it runs at all.
(BTW, other horror stories.. $DB_password in line 200 or so. No primary keys in our DB - or foreign for that matter. We have no idea of a schema... And on and on and on.)
For example, we double check a lot of persons' "status" in our programs. We do these checks to ensure that when someone requests help (for example, financial help) for these persons, they are entitled to receive that help. Now that "someone" is a bunch of other institutions as well as a bunch of private sector operators. They would benefit to see what sort of checks we do. That would help them to understand why we sometimes refuse to help some persons, they could learn from our stuff. That would also help other organisations (e.g. activits/NGO) to criticize the quality of our code (because what we do is quite connected to interpreting the law, thus a second opinion would definitely be useful).
Although I'm all for those two benefits, one has to realize that they are politically incorrect. The first one because, by keeping knowledge you just make your institution more important. The second one because a public institution must give the impression that it is perfect (because you run on public's money...).
edit: (oh and since "it" has happened in the past : this my own opinion, not reflecting the one of my employer)
Their mindset usually is:
"better keep it hidden, even if we leak citizens private informations all over the internet."
"and at least our funding won't be removed because some shitty paper stumbles on those leaks and makes a big deal about it".
They deliver the same code over and over again to different gov agencies, charge them and leach from tax payers money each and every freaking time. The problem is that politicians know this (heck they even approve it), one would need to eliminate corruption to get it solved unfortunately that's easier said than done.