OK but that doesn’t work with your WWII analogy. We were not bombing Stalin while simultaneously working with him defeat Hitler.
WWII was merely an instance where we allied with a treacherous mass killer devoted to toppling Western governments whose double-dealings made necessary our intervention in that war. If we could ally with people (Russians) responsible for body counts several orders of magnitude larger than the Sunni and Shiite players combined, we can ally with the Sunni and Shiite factions opposed to them. The extent to which we cooperate will obviously vary. That's the nature of alliances - they are relationships of convenience.