Calling fouls on contested drives to the basket - accurately and consistently - is incredibly hard. And it's a necessary, structural part of the game, so we will struggle with it for the rest of time.
Spotting a whiny gesture directed at you, the ref, is not hard. And it's not an essential and necessary part of the game, it's a problem we can solve.
Impose a penalty, make it clear it will continue, explain it to the players before the season starts, and you will stamp out the problem. We've seen it done before, in all leagues. You make it clear that this is the new normal, not some passing fad that will change in a week, you train the referees and then make it part of how they're evaluated, and it will stop. Because it's an unnecessary part of the game.
NFL players don't routinely disrespect the refs, at length. You'll see a WR throw their hands up asking for a flag on occasion... and then hustle back to the huddle because doing more than that can get them in big trouble in a hurry. Are defensive linemen whining for a holding call every play? Is every CB yelling "pick play!" when they think it's an illegal motion? No, they get on with doing their jobs, because with rare exceptions, whining-for-calls isn't part of the sport's culture. And that culture can be changed if it's desired from on top. Much like how we no longer have furious, vein-bulging arguments between baseball managers and umpires.
(and needless to say, these Ts should be assessed at the next stoppage of play, like the flopping calls - they need not interrupt ongoing flow)