You don't pay taxes if you don't make money. Income taxes at least.
That being said, the teams are responsible for lots of different types of taxes, and the profitable teams are responsible for them too. The NBA has it's own expenses too, the league office, the referees, the D league, etc.
But it sounds like the cap is based on revenue. This includes concessions at games, probably parking and things like that. So include the salaries of those guys, cost of hot dogs, etc when factoring in profit, cost of running the arena, practice facilities, real estate taxes, accountants, cheerleaders, lawyers, coaches, training staff, advertising, ticket sales, etc.
There's so much more to an NBA team than the players payroll.
Also, there's probably more to an NBA than operations. If the team owns the arena, there are depreciation costs, possible impairments on that asset. The mavs are in a deep hole, probably from a lot of other ventures that the team takes on, not from paying dirk..
That revenue also includes merchandise, the nba store, which while profitable includes other expenses.