Totally agree, but I'm not sure which government would fund it. I know the US heavily funds quite a few dev tools, but would be reluctant to fund large consumer facing tools without multiple country cooperation.
(EDIT: mainly talking about Firefox here)
I don't think it's inherently unprofitable (and neither is most public infrastructure), but more that any possible step towards more profit would be almost always against the users' interest.
Like with motorways and much of other public infrastructure, competition is basically impossible (and would be too inefficient) due to the sheer scale of the project, and letting a for-profit run it would be nothing but harmful to the public.
Maybe Mozilla Foundation is one of those infrastructures inherently unprofitable, unattractive, not price competent on individual level?