Don't you ever do things outside of your regular job for 'fun'? Do you have any side projects perhaps?
For Musk, this is the equivalent of a side project---something within his field of interest, but not directly a money maker. It's both an interesting problem, and so happens to do good.
I think it would be good for society to encourage the rich to have this sort of interst, instead of just falling into the hobby of golfing or driving supercars.