I work in public sector too. Some of my code could definitely released (hell, we know about tests, we have thousands of them :-))
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)