That's a good question. There are a lot of government agencies, whole departments, that I don't think should be funded. That is to say, they should not exist. At one time, I would not have thought NASA was one of those agencies. However, now that a key purpose of our "space program" is to build self-esteem among Moslems, the whole concept of NASA becomes questionable. Perhaps it should have been questionable from the start, since there was always the possibility of its degenerating in some way, if not this specific way. It's a lesson about what happens when government does something.
If we start from the premise that, if something is of benefit, then the Federal government should fund it, then funding of basic research is definitely a go. However, that premise is nowhere in the Constitution.
Some people think that the reference in the Constitution to the "general Welfare" covers this.