The compartmentalization link is the closest is decent for this issue, but it's still about a technique used to deal with dissonance; whereas my concern is about why that dissonance exists in the first place.
Why do you think it is common for people to root for heroes in fiction that they would denounce and be horrified by in fact?