I'd be interested in hearing any of you opine more on that topic than Jennifer Washburn has written of it in her recent University, Inc: The Corporate Corruption of Higher Education.
MY spin on the topic HAS BEEN that the universities were nudged into that role when the Fed had ramped up military (war) research during the World Wars (mostly WWII, after Vannevar Bush, originally from MIT, who went to DC - and there's a book in the making, if someone who could DO the investigative research wanted to do it), then after WWII was over, the infrastructure had been built for a working relationship between the federal government and the universities, and the New Deal economy wanted work to be done to improve the quality of life in America (against some opposition), so, since the universities were better 'incubators' than private industry, they were tapped, then a long discussion proceeded about 'indirect costs' (paying for the costs of keeping the universities POISED to do the government's research, on the government's timetables and according to Federal agendas.
We got much out of all that, and it's not wrong for universities to get some 'piece of the pie' for hosting the work (and securing the Faculty appointments based upon their research promise AND for teaching - it's the nature of US thinktanks to have some based in universities/academia), since universtieis do NOT recover ALL Their costs for hosting the research (paid as 'direct costs'); they lose about 20% of their 'hosting costs' because the Fed caps (puts a ceiling on) 'cost recovery' at about "70%" (of what the actual direct cost of the research is).
Most schools have an indirect cost rate of about 50%; a few schools have indirect cost rates of closer to 65-70%, and a very few have indirect cost rates of over 100% - BUT the Fed caps them at around 66-69% (unofficially ~70%), so tuition streams, endowments, program income, etc. must make up the rest.