Here are some examples. Let's say I have to drive a doctor to a remote emergency clinic in order to save someone's life. But the doctor, while there, intends to also perform a vasectomy on another patient there. That's very close to what voting is (driving someone to a position where they can do something). I can drive the doctor to the clinic based on double effect, intending to save the life but not intending the vasectomy ... which would happen nevertheless as a consequence of driving him there.
So the principles of double effect must be that the good consequence must far outweigh the negative consequence. If, however, this doctor would, in addition to saving the life, intend to perform an abortion, I cannot drive him there, since the evil of the abortion is not clearly outweighed by the saving of the other life. Also, the evil effect must be indirectly caused by the original action, so driving him there does not directly cause the vasectomy, but leads to in indirectly.
So with Trump, one can argue that the evil of abortion far outweighs the evil of sodomy ... and it's unlikely that ANY candidate would outlaw sodomy anyway.