1. Love of the game.
2. They are acquiring enough money for retirement.
40 is mostly the age they retire. After that there will be no money entering in their accounts.
They still got 30-40 years to live and I dont think the money they got from playing basketball can afford that.
Add up the life they got used which is mostly expensive.
So business will be their option since they cannot be accepted in office works for that age.
I do think Dirk is a wise man. His Teacher might have already prepared him for that.
I remember Yao Ming when he retired, he got a contract to have a tour around the world to become an advocate of something so that can also happen to Dirk if he's out of NBA.
We can only hope that those players getting million dollar contract knows how to save, invest because we all know that once they retire there will be no money unless they got jobs behind, like team management. And we also have witnessed a lot of stars going bankrupt once their days in the NBA are over. Nothing is permanent as they say, so we hope Dirk is wise enough to have invested in NBA money so that he has a backup when he retires.
Have you heard about recent Kobe's investment exit?
https://www.slamonline.com/nba/kobe-bryants-6-million-bodyarmor-investment-now-worth-200-million/
I'm afraid that this is just a exception of the general rule and there are many players like Allen Iverson, who lost everything.
On the other hand, professional sports is also attracting a lot people looking to take advantage of multimillion superstarts. For example the accountant who cheated on Kevin Garnett:
https://www.slamonline.com/nba/kevin-garnett-suing-accountant-77-million/