Short answer - because they have to.
The NBA runs a soft cap, sort of like baseball. Meaning if this year's cap is 100 million teams can go over the cap within guidelines. There are just too many guidelines to cover in an answer.
HOWEVER, unlike baseball the NBA took a hard-nosed approach to spending in the last CBA (collective bargaining agreement). NBA team must spend at least 90% of the cap space available. If they do not the excess money to make 90% will be distributed amongst current team members (player's union divides money).
So if the Chicago Bulls were only at 70% of the cap of 100 million they don't just save 30 million. They must set up a fund of 20 million that will be split among the current season Bull's players. This has and does happen.
But... based on there also being a luxury tax for big spenders it is not normal for a team that is under the minimum to make it through the season staying under. Often a team that is over will trade away assets so that they get under a threshold to a team under the minimum. The team that takes on the player may get draft picks and cash to pay the player. Even during the tanking years of the 76'ers they were usually at the minimum or close and was actually a strategy to take other team's bad contracts to accumulate draft picks.
Also based on another answer I will add that NBA players and free agents have not held it against teams for being cap frugal. That is actually a good thing and makes it more attractive for a mid-tier star to come because that player knows they have a chance at a better surrounding cast. The last thing a mid-tier star wants is to join a team that has been maxed out for 10 years (see Knicks for like 20 years in a row until this off-season).