I get that you're trying to provide some nuance here, but let's not pretend that all police officers are honest and decent individuals just doing everything by the book. It goes both ways.
I wouldn't have minded this if I were pulled over for speeding and he noticed and added it to the ticket but to get pulled over for being poor, harassed and then written a ticket for the windshield crack...
Maybe that's an acceptable way for the police to pull anyone they feel like over, but there should be some sort of suspicion required. I know this is the everyday experience of a lot of people but I don't think it's acceptable for it to happen to them either.
I've been abused in a similar manner, versus given a warning and relevant "counselling" (how to not get pulled over) from an officer with a more mentoring style.
Of course, being legally required doesn't mean it is actually the practice.
Maybe not, but by the same token it's not OK for them to add to a ticket because their ego is challenged, and to do so raises all kinds of unfavorable stereotypes about law enforcement.
There is no reason to get argumentative with someone doing their job, let alone a traffic cop. All that while they are working on your incident they have to watch out for traffic, your actions, and ensuring you don't get so excited your a threat to yourself or them.
More than likely, being familiar with "our type"; techies, she came off as a pretentious twit and treated him with contempt for being an ignorant cop.