It is one of the most common reasons people invest though so it's entirely relevant
However you don't know how long you will live. Don't be a miser who spends nothing. If you have surplus after the above you should either spend it or donate to charity.