The NBA has a brand. The individual teams are the franchises. Much like Burger King or McDonalds has a brand, and many individual owners have franchises. Yes, it is illegal for owners of different franchises to set up a common salary structure. For example, the Burger King at the Dayton Mall, the one in west Carrollton (just over a mile north), and the one in Miamisburg (just over a mile west) can't jointly agree that the pay of shft managers will range from X to Y. If they do, they can be sued. There are many steps corporate brands can take to ensure the brand reputation (for example, dress codes and drug policies). Pay rates are not among them. The only way for even the lusxury tax to be legal is for it to be negotiated with the players acting as a whole.
I'm not an attorney or familiar with franchise law, but the NBA is itself a franchise that the teams have to buy into, and they have the right to set standards for their franchisees. You can't compare them to Burger King, as Burger Kings don't compete with one another for talent, tv exposure, draft rights, and compensation from one another for trades.