Anything written by federal contractors, and anything written with state funds are not in the public domain. National labs flat out refuse to release some of their source code.
The contractors don't have to be.
It's the same reason why most people stay out of federal jobs - you can't make more than the president. But if you're a consultant working for the gov't, you can get paid $$$$$.