Also, SpaceX IS mostly funded by NASA anyway as a government contractor. SpaceX exists because the government wanted to create a private space market. Strangely thank George Bush for it. https://www.fool.com/investing/2017/02/05/how-profitable-is-...
As you can see, SpaceX was so cash strapped in 2017 it obviously didn't go to mars in 2018 as they wanted. Also notice Elon didn't fund that trip (otherwise it would have happened). There is no way he would risk HIS own money on that.
This would mean that SpaceX would need to develop and fund Dragon 2 propulsive landing on their own, with only real mission fully requiring it being Red Dragon.
In the end it was much easier to just drop the whole thing, especially with the much more perspective Starship on the horizon.
SpaceX being private has a much larger cushion for failure. Elon will keep funding it far longer than congress would Nasa is my guess. If SpaceX loses some rockets that's the cost of business, of course once those missions are manned it's a huge difference but until then I think it's not really comparable.