It's worth working on a project you care about. It's ok if the manner in which you care is that you care about making a lot of money and that the problem you are solving is one that you don't care about directly...but it's probably harder to maintain caring only about the money over the long term.
The big problem is it's easier to care about the solution than the problem because coding is fun and other people's problems tend not to be fun. This leads to imagining problems that other people have and building solutions to those imaginary problems instead of actual problems. So it probably helps to start from caring about the people and then the problems they care about matter more than the solutions to problems you imagine they have.
It's even easy to solve problems that you imagine you have...because again, coding is fun and people's problems, especially your own problems, aren't.
tl;dr Do something for someone you care about that that person cares about. It doesn't really matter the person you care about is you or someone else.
Good luck.