When told by voting staff that there was no firearms allowed, why couldn't he have just secured it in his car then vote, regardless of whether or not he was in uniform? A one minute walk to the car would have diffused the situation.
Because sometimes you have to make a stand, give makers of arbitrary rules an inch and they'll take a mile. An armed police officer at the polls means a safer polling place anyway.