My D&D groups storyteller is very good at doing this. The end boss we've been building up to for forever is a devil and quite explicitly evil, but the encounters leading up to that point are very questionable.

My favorite example, of course, is the lich. The wizard Sation made a pact with our devil, but the devil twisted the deal and committed horrible atrocities in his name. Feeling that letting the devil commit these heinous acts was a far worse crime than any he could commit personally, he decided to perform one last vile act to seal his soul away in a phylactery and become a lich.
So the lich became reclusive, withdrawing into his wizard tower and an island that has been uninhabited since the devil wreaked havoc on it. He had stashed his soul away and become immortal explicitly to prevent the devil from being able to claim his soul upon his death, and locked himself away so he would neither bring misfortune to those who do not deserve it nor draw attention to himself and bring would-be heroes to his home to try killing him and sending his soul to the devil.

And yet, that's exactly what ended up happening. Our group caught wind of this wizard who had made a pact with our ultimate enemy, so we went to investigate.
Two of us being chaotic good said, "We're here to prevent the devil from being able to claim his soul upon his death. That's exactly why he became a lich in the first place, verbatim. He clearly despises Tigla and has gone to great lengths to try escaping his infernal pact. If we can get a cleric to cast Atonement and redeem him, he could be a powerful ally. The enemy of my enemy, as they say."
The other two, being not only lawful good but also religious zealots, said, "We won't hear of it. This twice-forsaken thing has cast away his soul twice already. Once to the devil, and again to cheat death. Even if he could be redeemed, he would still be an abomination. He must be destroyed."
The party split in half for that particular fight, and the side that wanted to kill the lich won