Oddly I agree with your description but not the solution. NASA doesn't need longer term goals - it needs shorter term goals. I'd say don't fund anything that takes longer then a single presidential term. That would limit what's possible but increase the likelihood that something will get finished.
If the president says my goal is to land humans on Venus (with asbestos booties naturally) in 20 years then odd are in 4 years the new non-crazy president will scrap that goal and change it to land on Jupiter in 20 years. And then it will be to put a flag on the Sun. And so on.
With 4 year goals the goals may be idotic but they will probably be finished because it'll be a single lunatic from start to end.
It's also possible that from one crazy administration to the next there could a chance to build on what was accomplished so at the very least something will be accomplished.