Writing is one thing. Publishing that writing - sharing it with the world - is something entirely different.
There are many reasons why writers ultimately decide to publish their work. In some cases, it's because they want to offer a memoir or a novel to their family and friends, and anyone else who happens to be interested. In some cases, it's because they are in a business where a book about their experience or expertise will help them get consulting or speaking engagements. In other cases, it's because they haven't seen sufficient interest in their work from traditional publishers. In still other cases, it's because they are not getting the royalties from traditional publishers that they can get by self-publishing.
It's almost never to make a lot of money.
That said, as Chris Brogan points out, there are many ways that self-publishing can lead to a decent living (so long as you are not publishing fiction). And there are many reasons to publish besides the money (and this includes publishing fiction). But making a lot of money by publishing a book (traditionally or independently) is about as likely as making a lot of money by playing guitar in local bars. It can be fulfilling and wonderful in its own way, and there are many reasons to do it. Money, however, is not going to be the primary motivation.
And that's fine. Very few traditionally-published authors make their living solely on the basis of what they publish, at least initially (and this is especially true of fiction writers, many of whom write their first novels while working as teachers, lawyers, or other professionals). If we look at the nonfiction side of the New York Times bestseller list, we can see that those authors all do other things besides write and publish books - they are television personalities, professional journalists who are expanding on magazine pieces, scientists, sports figures, politicians, doctors, or consultants.
The point at which your writing begins to earn you lots of money is a happy accident. Publish because you have something to say, and you want to share it. If enough people want to hear it, the money will come.