I wonder why publicly-funded grants do not systematically demand from the recipients that code and data to be released, and results/papers to be publicly accessible. (put aside data that raise privacy issues)
Because there has not been a strong enough push to require it and some researchers prefer to keep code/data confidential. This is currently a topic of discussion at the national level led by organizations such as EFF. This is hopefully a situation that will soon change for the better.