Not to nitpick details, but according to a web search, Rafa's net worth is $220 million. No small potatoes, but even if we pad it a bit, that's a quarter or third of a billion.
And I totally agree that he won't play for money - that's an absurd idea, quite frankly. I'm sure one of the Nadalites can speak more accurately to his motives, but my guess is a combination of love of the game/competition, records/legacy, and perhaps out of some sense of duty to his fans.
Given the setbacks he's undergone these last two years, I would guess it is more the 1st and 3rd...love of the game and for his fans. I'm not sure what else he can do to pad his record, and he must know he's got very little chance of catching Novak in the Slam count. I think he just loves tennis, loves competing, and loves his fans. After the last two decades (three, really), and being one of the best who ever played, it is a hard thing to give up. Roger didn't fully give up until he started slipping out of elite level. He was still playing at a very high level in 2019 and the beginning of 2020, but when he came back in 2021 he was a shadow of his former self. The writing was plain on the wall.