I suppose everything can be compared to something else. Has anyone ever spent a dollar on an item they don't 'need' when others in the world don't have proper medicine or nutrition? Is it okay for the government to stop all education funding and put all that money into health? Of course not. Science investment isn't a bottomless pit without a return. It develps a science and technological infrastructure in a country which, in turn, underpins such activities as looking for a virus vaccine, building an efficient fuel-cell car, etc.
A more pressing issue isn't so much the amount of money that government invests in education, the sciences, research, etc. as much as are those dollars the most productive in building an intellectual infrastructure.
A major reason we won in WW2 wasn't that we had more planes and ships and tanks, etc. in 1939 but that we had the know-how and industrial infrastructure to develop and produce those items.