take it to court for sure, it sounds like you've received an unnecessary ticket.
My father is a recently retired ontario provincial police constable, I can assure you that cops aren't all dicks, but some (especially the younger guys) have a chip on their shoulder and something to prove, often starting confrontations in a negative manner. However, the important thing to consider is they probably think they are doing the right thing as far as the masses are concerned - It's the truth that sometimes "a good talking to" can serve much better than a ticket. Which they think will correct the negative behaviour.
He's said the profession just isn't the same as it used to be - the general public looks at police as the enemy and often don't offer any respect. He told me the best advice is to be respectful and tell the truth, it goes much farther than trying to lie to them. It sounds like you've done just that...so I'd say you've come across one of the jerks in the profession.
it's just unfortunate that a lot of cops out there can be unreasonable and unfriendly. Just don't hate all of them because of a few bad ones.
best of luck in court! you'd be stupid not to go!