For the sake of high-quality science diffusion, there is no doubt that reproducible research is a good practice as it helps to demonstrate the robustness of the proposed methods and boosts the possibilities of getting more citations for a published paper. Needless is to say that it also allows new researchers to continue the work of a previous mentor. For students wondering if they should or should not release their code in a public repository, this was a topic already discussed here: Is it beneficial for a student to publish their research code and data?.
However, my understanding, from this material, is that reproducible research is a practice followed by institutions in which the government takes charge of the salary earned by researchers, their equipment, and travel expenses. Given that public funds are used in this context, there is no point in publishing results in places that would keep the knowledge inaccessible to the people who need it (and pay for it with their taxes). In fact, many journals offer now the possibility of publishing papers as Open Access. Obviously, this exempts the case of national security affairs that need to be kept in secret.
For independent researchers or non-granted students, the things change a little bit, as they don't have to follow the reproducible research practices because they pay for most (if not all) of the expenses during their studies. My question is, what are the incentives (if there is any) for this group of people to release their code on the internet if they are not looking to exploit it commercially? Is reproducible research something that they can use to improve their chances to get a job in academia or an R&D department in the industry?
Note: by reproducible research, I am taking the definition stated here: all the results from a paper can be reproduced with the code and data available online.