I don't see much difference between giving science team a grant and giving research company money to develop cool robot. Either way it's giving money to the people that free market doesn't want to fund so they can do the stuff that free markets deems too risky to undertake.
I don't think JackFr sees a problem with giving grant money to an R&D company. JackFr is most likely referring to tax breaks, subsidies, and other assistance that government gives to non-R&D companies in order to prop them up. A few examples:
Agricultural subsidies for big agricultural companies
Starbucks gets real estate deals that smaller cafes cannot. That's why there is a frickin' Starbucks on every street corner.
Bank bailouts
In those cases, government is actively picking economic winners and losers, not funding basic research.
I might imagine good scenario of goverment giving money to some large player in non-innovative industry so they can modernize instead of waiting a decade or so for small more up to date company to grow and eat old behemoth. It's picking winners and it's not fair but it doesn't matter who wins as long as technology advances. It's not like people are in the business only because it's fair.
But generally I agree that examples you provided are bad goverment spending. Subsidizing agriculture is actually subsidizing poor that would not be able to afford food if consumers would need to pay for it 100% out of their pockets. Bank bailouts came out of fear that economy could not take massive bank bankruptcies. I can't even imagine what goes on with starbucks. Those are bad reasons to give money. Money for food should be given to poor in form of basic income and farmers should compete for that money like every other company. And gambling banks should be allowed to fail if they were allowed to gamble. Real economy is much more resiliant and it's pretty distanced from financial markets "economy" to be seriously harmed by collapse of multiple banks.