Government should be involved when there are major externalities that the market won’t address. Most die hard free market economists would agree with that.
For instance, they must regulate communications because the airways are limited and a free for all would render communications useless.
The government getting involved in basic research is also necessary sometimes.