Tim Donaghy, a former NBA referee, wrote a book titled Personal Foul (it was originally titled Blowing the Whistle but was renamed after he had to find another publisher).
Deadspin published some excerpts from the book. Donaghy wrote that the fans pay to see star players score a lot of points:
You would think that the NBA would love a guy who plays such great defense. Think again! Star stoppers hurt the promotion of marquee players. Fans don't pay high prices to see players like Raja Bell — they pay to see superstars like Kobe Bryant score 40 points. Basketball purists like to see good defense, but the NBA wants the big names to score big points.
Donaghy then wrote that star players get preferential treatment when it came to foul calls:
If a player of Kobe's stature collides with the likes of Raja Bell, the call will almost always go for Kobe and against Bell. As part of our ongoing training and game preparation, NBA referees regularly receive game-action video tape from the league office. Over the years, I have reviewed many recorded hours of video involving Raja Bell. The footage I analyzed usually illustrated fouls being called against Bell, rarely for him. The message was subtle but clear — call fouls against the star stopper because he's hurting the game.
He also wrote about how if a star player was in danger of getting into foul trouble, then the referees would try to keep him from being benched by only calling obvious fouls on him or trying to give fouls to other players:
If Kobe Bryant had two fouls in the first or second quarter and went to the bench, one referee would tell the other two, "Kobe's got two fouls. Let's make sure that if we call a foul on him, it's an obvious foul, because otherwise he's gonna go back to the bench. If he is involved in a play where a foul is called, give the foul to another player."
He also wrote about how referees would start calling fouls in games that became too physical in order to try to rein in the players. He said they would only call those fouls on non-star players to ensure that the star players remained in the game:
Similarly, when games got physically rough, we would huddle up and agree to tighten the game up. So we started calling fouls on guys who didn't really matter — "ticky-tack" or "touch" fouls where one player just touched another but didn't really impede his progress. Under regular circumstances these wouldn't be fouls, but after a skirmish we wanted to regain control. We would never call these types of fouls on superstars, just on the average players who didn't have star status. It was important to keep the stars on the floor.
Of course, Donaghy is a convicted felon and the NBA and many other people think he has no credibility. Henry Abbott wrote an article for ESPN.com in which he examined the book. He said that some of the claims in the book were refuted by Charles Barkley, Phil Jackson, and others. But he didn't provide any evidence or quotes from anyone to either support or disprove the claim that referees give preferential treatment to star players in terms of foul calls.