To further explicate on what Suscipe said, it comes down to intention. Let’s say you had a pro-choice candidate whom you agreed with on every other issue (assuming all the agreed with stances were moral) and the pro-life candidate was utterly catastrophic in all other matters. Voting for the pro-choice candidate for the reasons you agreed with, not because you supported the pro-choice stance, would be acceptable, though we must weigh the good affects you expect to come against the bad.
It would also be acceptable to vote for a pro-choice candidate for their pro-choice stance if it’s more limited than current laws. Example: A candidate is pro-choice, but believes it’s wrong to abort a viable in-utero baby in a society where aborting at that point is legal. Voting for them because of that pro-choice stance, not because you agree with pro-choice, but because you believe it would limit abortion, would also be acceptable.
What would not be acceptable is voting for a pro-choice candidate because they’re pro-choice or voting for a pro-choice candidate because their other ideas would be benefitting you. (Assuming the benefit isn’t just due to overall morality that benefits all people.)