Tesla and SpaceX aren't worth that much for much the same reasons you've outlined - they have massive capex requirements, high employee overhead and retention costs, and really real technology risk (it's literally rocket science).
At least they have something they can sell afterwards...
If I sell you a Book for a million dollars, I make 1 million dollars. If I sell a million books for a dollar each, I make a million dollars. My Company is worth a million dollars. It makes no difference to the quality or what i am selling.
That's not how valuation works, and that's not how revenue models of companies work. Please make less useless comments.