IMO most people do it just for the sake of arguing. They're so self-righteous and lonely (thanks to all the self-righteousness) that they'll throw major hissy fits any time anyone engages with them in a way they can't 100% control, particularly with cops. For whatever dumb reason I can't find the same videos on YouTube, but I've seen one of a guy who wasted everyone's time during rush hour on a subway refusing to show his ticket because he didn't have to, you're not the boss of me, wahhh, and another of a guy strutting into court just to say "I'm here for my proceedings but I don't have to tell you my name because you can't make me and now I am going to walk past you" and crying when he got tased.
So I'd say for some it's a last-ditch effort to get out of a petty crime that would be a lot easier just taking the ticket, and some go out of their way to do it because they have a need to argue with everyone.