Not true, for the same reason that commercial ventures don't like to release source code even if they don't have something to hide.
Having a capable computer code can be a substantial competitive advantage and make it possible to do studies no one else can. While this is less than desirable from the standpoint of science, it's perfectly understandable given the career pressures that individual scientists operate under.
Though it's hard to find a situation where people don't have a (short-term) incentive to make their work look good. One can hope it will catch up with them in the long run, but more likely by then they have a new job (and, in academics, tenure) that will never hear about their past shoddy work.
That makes code development beneficial for your career, gives an incentive to not keep it under wraps, improves quality, and is likely to reduce the number of published incorrect results.
Of course that is a pipe dream at this point, but what's wrong with dreaming?
Another reason not to release source code is that there might be obvious follow-on work and you want to publish that paper too, rather than help someone else scoop you by giving them your tools.
Where possible, I open-source everything I try to be published. There's only one project I haven't (a scraper for the WoW Armory), but even then I released the library I built for it.
There's no excuse to not do so. Unless you have something to hide.