Wikipedia
Self-licensing (aka moral self-licensing, moral licensing, licensing effect, moral credentials) is a term used in social psychology and marketing to describe the subconscious phenomenon whereby increased confidence and security in one’s self-image or self-concept tends to make that individual worry less about the consequences of subsequent immoral behavior and, therefore, more likely to make immoral choices and act immorally. In simple terms, self-licensing occurs when people allow themselves to indulge after doing something positive first; for example, drinking a diet soda with a cheeseburger can lead one to subconsciously discount the negative attributes of the meal’s high caloric and cholesterol content.
Self-licensing can have negative societal consequences since it has a permissive effect on behaviors such as racial prejudice and discrimination, selfishness, poor dietary and health habits, and excessive energy consumption.