NASA hasn't had a proper goal or mission for decades. That's their problem. And the spaceflight goal that everyone wants -- making things cheaper -- is not something that government agencies are particularly good at producing.
You can point to any administration in the government and make the same statement. They're mostly defensive administrations; making sure things aren't getting out of control. NASA almost by definition needs a technical project and problems to solve. They were never a defense administration keeping the status quo.
Their goal and mission of returning to the moon turns 25 this year. But you're right, it has hardly ever been a proper goal. But that's the manned program only. The unmanned planetary science program has been hugely successful relative to the amount of money they get.
That said, SpaceX exists entirely due to early NASA funding.
It's hard for NASA or any government agency to have a real vision for anything longer than the current administration it is operating under. When the current POTUS can replace the head of that agency to install someone that more closely aligns to their views, you get ping ponging agendas. Stop everything you're doing because POTUS does not believe in it. Okay, just kidding, new POTUS disagrees with previous POTUS, so go back to what you were doing. That's not a problem to do after stopping work for 4-8 years, right?