Every piece of academic code I have ever seen has been an unmitigated nightmare. The sciences are the worst, but even computer science produces some pretty mind-crushing codebases.
So, I don't blame them for being embarrassed to release their code. However, to some degree it's all false modesty since all of their colleagues are just as bad.
Add into this the fact that no one in academia understands version control systems, and it's a hard hill to climb.
Perhaps this attitude contributes to the problem (I am not excepted from it). If you were given an earful about how your code is an unsalvageable flaming pile of rubbish by everyone you showed it to, would you want to release it alongside a paper to which you've given years of your life?
Yeah no kidding. There's a huge difference between the disposable one-off code produced by a scientist trying to test a hypothesis, and production code produced by an engineer to serve in a commercial capacity.
The original transistor, produced by Shockley and team at Bell Labs, "worked" only in a nominal sense. It didn't do anything other than prove a concept. To turn it into something usable in real equipment took years of effort by other scientists, and engineers. Thank god they published the details of it rather than saying "we made it and it worked, here are the results" because they were afraid of releasing something that was "a pile of rubbish."
Additionally, every piece of academic code I have ever written has been an unmitigated nightmare. Something about academia drags down the quality of my code. My industry production code is much better (or so I tell myself).
There is a very simple explanation. You are not payed to produce code or finished product. While I can't speak for the entire academic CS community, we are constantly under pressure to write less code and write more papers.
I really hope that publishing the source code along side the article becomes the standard, if only that it would give us an 'excuse' to polish it up.
If one of the key ideas behind Science is thorough peer review, and the code that your paper relies on is essentially unreviewable and untestable, how is it any different from just not releasing it?
So, I don't blame them for being embarrassed to release their code. However, to some degree it's all false modesty since all of their colleagues are just as bad.
Add into this the fact that no one in academia understands version control systems, and it's a hard hill to climb.