Musk did not start SpaceX to create wealth. He did it because he wanted to colonize Mars.
Initially, Musk tried to buy a launch from a Russian provider to land a greenhouse on Mars.
Musk: In 2002, once it became clear that PayPal was going to get sold, I was having a conversation with a friend of mine, the entrepreneur Adeo Ressi, who was actually my college housemate. I’d been staying at his home for the weekend, and we were coming back on a rainy day, stuck in traffic on the Long Island Expressway. He was asking me what I would do after PayPal. And I said, well, I’d always been really interested in space, but I didn’t think there was anything I could do as an individual. But, I went on, it seemed clear that we would send people to Mars. Suddenly I began to wonder why it hadn’t happened already. Later I went to the NASA website so I could see the schedule of when we’re supposed to go.
Musk: So I started with a crazy idea to spur the national will. I called it the Mars Oasis missions. The idea was to send a small greenhouse to the surface of Mars, packed with dehydrated nutrient gel that could be hydrated on landing. You’d wind up with this great photograph of green plants and red background—the first life on Mars, as far as we know, and the farthest that life’s ever traveled. It would be a great money shot, plus you’d get a lot of engineering data about what it takes to maintain a little greenhouse and keep plants alive on Mars. If I could afford it, I figured it would be a worthy expenditure of money, with no expectation of financial return.
(emphasis mine)
But the process of buying the Russian rockets (repurposed ICBMs) got him thinking about the economics of a rocket launch:
The real reason we weren’t going to Mars wasn’t a lack of national will; it was that we didn’t have cheap enough rocket technology to get there on a reasonable budget.
Musk: We needed to set rocket technology on a path of rapid improvement. In the course of trying to put together Mars Oasis, I had talked to a number of people in the space industry and got a sense of who was technically astute and who wasn’t. So I put together a team, and over a series of Saturdays I had them do a feasibility study about building rockets more efficiently. It became clear that there wasn’t anything to prevent us from doing it.
Musk took a big risk starting SpaceX. After 3 of his Falcon 1 launches failed, he was days away from bankruptcy when the fourth launch succeeded.
These days SpaceX is very successful, but the Falcon 9 is nothing more than a stepping stone, an intermediate design that helps generate revenue and engineering information for the real goal: developing the BFR, the largest rocket ever, designed to be fully reusable and capable of regular roundtrips to Mars.