Because in those players' views, the risks, most notably injury risks either from directly being injured in the Olympics or an increased injury risk the following season due to having less off-season, outweigh the benefits. I doubt it would seriously affect LeBron James's earnings power if he won the Olympics or not, his reputation is built on what he's done in the NBA, not what he may or may not do in the Olympics. For better or for worse, the basketball industry views an NBA title as much more prestigious than an Olympics gold medal.
2021 is of course also a special case due to COVID-19: during the offseason, players are largely in control of their own environment and can take whatever measures they deem necessary to reduce their risk of contracting COVID; at the Olympics they are necessarily in proximity to a much larger number of other people.
Simply put, the NBA championship is far more prestigious than an Olympics championship. This is because the NBA and the US itself hold a huge percentage of the top players in the world. Also the Olympics participation doesn't add much to player endorsements.
Years after a player is retired, they'll hardly be judged by how they performed for team USA, but rather judged on how many NBA rings they won. With the Olympics being right after the end of the postseason, you often see top players who made it deep in the finals skip the Olympics. So they can get a rest, and heal from injuries.
But playing in the Olympics has its own risk of injury. Players aren't paid to play for their national team, so if they get injured during the Olympics and miss out of the NBA season, they potentially lose out on their NBA contract's bonuses. For example Paul George broke his leg playing for team USA and ended up playing less than 10 games the following postseason.
Team USA has so many stars, had each country been able to send multiple teams, they could win all medals. They've been the overwhelming favorites to win gold since they started sending NBA players. So there's also less expectation or reliance for these top stars to show up for the tournament, knowing their replacements can still win the Olympics gold.
In addition to alamoot's and Kendall's answers, with which I completely agree, I would add this. Even without considering injuries, the Olympics represent a high-risk, low-reward scenario. If you win, so what? You were supposed to. If you lose, like in 2004, you were the failure of the nation and you'll never hear the end of it.
Moreover, on Golden State, Curry is the man; the offense and defense are tailored to him. Curry, like Lillard in Portland or James in LA, is uniquely set up to be the deciding factor in the game. On the Olympic Team, a player's individual ability to decide the outcome of a game is far more limited. In the mind of a top player, they could lose a game because other people, essentially, got in his way.
This is not being petty; endorsements, recruiting (both being recruited and being able to recruit other players), even post-career employment opportunities may be effected by losing in International play. NBA players are said to make a "Business Decision" when they step out of the way instead of being dunked on. How much more of a "Business Decision", then, must be the possibility of losing in the Olympics?