If that's the case, then why does other country have their NBA players still play for the upcoming FIBA world cup? They should have also been restrained from participating too since they have obligation in the NBA?
Those who want to participate in the NBA will do that and those who want to play for their country in the world cup has the choice of doing that. Players such as Giannis Antetokounmpo of Greece have opted for the world cup, but most of the American heavyweights (including James Harden, LeBron James, Williamson, Lillard, Curry, Irving, and Kawhi Leonard) have opted for the NBA. It's just a personal choice.
There decision is good, they can focus on the upcoming season and they can give a chance for the other players to shine.
USA has a lot of talent, so that's not a problem and star players in the NBA will not be guilty even if they choose not to participate, if you look at the betting odds, USA is still the favorite to win the FIBA and actually a heavy favorite.