Seems too me he was having, a- a really bad day and just wanted to have a confrontation or, b- the local troopers have a "quota" but won't admit it.. The local police management here call it a performance expectation and he was trying to squeeze in his performance before the deadline and it sounds like quite a performance.
I also suspect that Steve O is on to something with the jealousy. Sometimes I see people, especially traffic bastard cops lol that their attitude is if it's extra nice I will find something to get him.
This all being said, looks up the act under the ticket wording. I know it's different here but I would guess that like here it states something along producing a glaring or blinding light as the catch all and that's why the wording doesn't match the suggested inaction.
I'd fight it. In my OPINION it's worth a try. If you lose, you haven't lost anything more. I would suggest taking all documentation that the dealership repaired your damaged vehicle, specifically font and some specs on your headlights.
Couple questions, have you checked the aiming of your lights? We're they a little high? Was the road wet and causing more glare? Was it a crown Victoria, Taurus, charger etc? (yes it makes a difference) and hae you or someone else done the mid perch or front suspension mods since aiming the lights or were they re aimed after doing so? Was there anything in the bed?
All of these things could cause glare, not your fault but he's clearly an ******* and doesn't know how to contact low and escalate as necessary... Sort of like week 1 at the police academy stuff.
There's no need to be giving tickets to good people. Only the wreck less on road drivers, arrogant, or real criminals deserve tickets like this.
There's no excuse why he couldn't pull over and let you pass to stop the issue he was having with your lights. Seems like he could also have this as his go to ticket to meet his expectation as its easy when he sees a truck and the courts may view it as an officer perception call to issue which does make it harder to defeat in court.
All in all he was an ******* and has no logical excuse. I appreciate you not painting all Leo's with the brush he was waving around, I feel for you.