Rdl is correct. Smart people often get hired by small firms which do contract work for government organizations. It allows the smart people to live outside of the hierarchy imposed by a large institution.
The motivations are very similar to startups working outside of larger companies. You get more freedom in work choices and pay scale.
I mean I am overstating the case for effect here, and I am sure there are small cliques of competent people hidden within big organizations everywhere, but if this were a government official project, it wouldn't have been done by those people. I knew brilliant people in the military in Iraq, but they weren't brilliant due to their jobs. If we did awesome stuff on the side it wouldn't have been a product of the US government.
Government also discourages small side projects, especially in the classified world, and particularly discourages them from becoming production. They would far prefer to run a program of record, or pay for (well defined) innovation by third parties.
The motivations are very similar to startups working outside of larger companies. You get more freedom in work choices and pay scale.