How does an anti-abortion politician get a good rating from planned parenthood?
Because he votes for abortion policies.
If you can't separate the following:
1. Your personal views
2. The views of your constituents
3. The objective best decision for your constituents (specifically, the people who vote you into office or live in your jurisidiction).
4. The objective best decision for your country (these are your constituents too, they just aren't the people who vote you into office. A Senator from New York makes decisions which affect people of all US states and territories, not just the people of New York)
And if you can't juggle all of these considerations in making an official policy stance, then you aren't doing your job.
No legislator should 100% of the time vote in accordance with their personal beliefs, or 100% of the time with the beliefs of their state/district. They should vote 100% of the time with what is objectively the best course of action. That may not align with their feelings or ideology.
(Which is why it's ridiculous when the GOP does things like unanimously voted against Obamacare when the alternative was...doing nothing and maintaining the status quo)