Why don't we publish our code? Do you publish one-off shell scripts or database migration code? The only important code is already open source or is (unfortunately) commercial in nature.
The point is that scientists don't need to publish certain things, one of them being the source code that helped them discover their findings.
Shell scripts and database migrations aren't super interesting, but you would want them if you needed to replicate results. I'm not saying they're interesting as published research, but neither is that random piece of scratch paper you used while trying to understand what is going on in some biological process.
It seems like the problem is that non-scientists don't understand the way science happens, and that often the source code isn't something that you would include in an academic journal.
Should science be done differently? Maybe. But that discussion is different than "why wont they publish their source?"
Maybe there is a barrier to adoption in the form of git. A more polished version of Gist - marketed to scientists and researchers - would increase uptake.
Science is discussed and advanced through papers. These papers aren't an exact recording or rendition of what was accomplished, but a discussion of the idea, methods used, and eventually a conclusion. Methods may be algorithms, but it doesn't necessarily mean the actual source code.
The idea is that the actual code that a scientist used isn't terribly valuable. If another scientist wants to verify the conclusions, they should just whip up another bit of code (or, do the same experiment) themselves.
Asking for scientists to contribute source code is not wrong, it just isn't done (to my knowledge) with other modes of scientific exploration.