To be fair, a lot of people do publish their working code with the paper. It helps people like me understand how to do the work.
Bad code is fine, good code is better, great code is great. Stick to fine and I can do my job and you can write papers knowing that your work will be used by many.
The CRAPL: An academic-strength open source license http://matt.might.net/articles/crapl/
A much bigger problem is that grantsmanship strongly incentivizes against verifying your methodology and being diligent in your construction of null hypotheses.
Well, if you're embarrassed by your terrible handwriting, maybe it's a time to put some effort to improve it.
Especially because if you are forced to publish your code, it will be better.
Academic code sometimes only has been made to work on one machine (the author's). Someone reproducing the results should still have access to the source, even if they have to hack it to work on their system.
;)
But seriously.