One detail some might not realize is the fact that research code is often a heaping pile of garbage written by a single graduate student. Some are ashamed of their code and simply don't want to publish shit code. Also, strategically, it is probably better to _not_ publish code than risk being rejected by a future job interviewer because your research code is shitty and you didn't prioritize refactoring it.
With that being said, this is not an excuse for refusing to share paper code or making sure the experiments are reproducible.