Here are three definitions for this term from three separate dictionaries.
cognitive dissonance?
Psychology
anxiety that results from simultaneously holding contradictory or otherwise incompatible attitudes, beliefs, or the like, as when one likes a person but disapproves strongly of one of...