They fund universities like anyone else. Yes, there is some internal research, but even in fields like math, where NSA probably does a lot of internal reseach, you still have classified top-secret research performed in public universities.
There is in fact no fundamental difference between a manager deciding what projects to take on and a bureaucrat deciding which projects to fund from public money - in both cases, the person doing the decision is not using their own money, and they don't have the full qualification to make the best scientific decision. Even if they do, they are held responsible by people who do not (upper managers / higher level bureaucrats), who will evaluate them more on the process they followed than on actual results (especially as results are likely to be far off).
Even though 'a company is putting its own money behind the research', it's still people who don't own that money taking the actual decisions. Even start-ups are usually not using 'their own money', but investors' money, with the investors taking the role of grants approvers.