Maybe the trooper couldn't see the lane to your left was full of traffic. Regardless, it will come down to your word vs his, and Im sure the judge will take his.
Only thing I will say is I HATE to be behind trucks I can't see around. I will slow down when Im behind a truck to give myself more space to see around him better. Situation like this confirms that Im doing the right thing in that regard.
To answer your subject question, you could have given yourself more space behind the truck. Sure, someone else may jump in the gap, and if it's another truck, slow down a tad more. If it's a car, he probably won't stay there long.
Sorry you got a ticket.
Mike