This is because space programs are a great tool of presidential politics, which operates on 4-year cycles that are completely useless for long-term space policy.
Perhaps a solution is to have NASA administered by a board that's appointed for life similar to the Supreme Court -- its total budget will still be subject to the vagaries of political squabbling but at least its ability to allocate budget to programs will be unencumbered.
To an extent, this is an oddity of the US system, where a lot of the civil service is run by appointees. In most modern parliamentary democracies, the civil service is largely static and non-appointed, and while the government can in principle get rid of, say, a permanent secretary, it's highly visible and would rarely be done. This tends to give long-term projects more inertia; if the government wants to kill one without considerable controversy, it really has to make a case for doing so.
This is a very interesting proposal. There are a number of large-scale and long-term problems that require consistency of vision beyond election cycles. You should write up this idea in a formal way and see if you can get published as an op-ed somewhere.
Perhaps a solution is to have NASA administered by a board that's appointed for life similar to the Supreme Court -- its total budget will still be subject to the vagaries of political squabbling but at least its ability to allocate budget to programs will be unencumbered.