Greed is good. So is envy. So says Boris Johnson, who told the Centre for Policy Studies that the two deadly sins were “a valuable spur to economic activity”.

Boris was invoking behavioural economics to make his point at the Margaret Thatcher Lecture, but this discipline also teaches us that envy can be harmful, particularly if taken to extremes. It would be dangerous to become complacent about income inequality. Excessive income inequality can in fact be counterproductive for economic success, precisely because it generates emotions such as envy.

Envy is a double-edged sword in terms of promoting positive economic results, because it arises due to concerns about relative position. When motivations are based on relative standing, there are two ways to come out ahead: perform well yourself, or hold back the other guy.

There are a number of careful empirical studies that show the latter strategy can be used, with harmful consequences. For example, greater rates of product defects can be observed when workers feel unfairly treated, or police having lower arrest rates after being denied what they viewed as reasonable wage increases.

Status desire doesn’t only cause inefficiency due to damaging behaviour by the lower ranked. A recent study in behavioural economics demonstrates a “taste for authority” can cause managers to choose inefficient systems because of a desire to retain the ability to tell others what to do. In general, those who benefit psychologically from inequality shouldn’t be in charge of determining whether it persists.

Where income inequality generates a perception of competition between upper and lower “classes”, the resulting emotions may be counterproductive. One recent study looked at Swiss Army officers randomly assigned to different platoons, which were then encouraged to compete with each other. This caused officers to engage in costly actions that harmed members of other platoons, even though such actions could not help win the competition. This illustrates how a sense of competition between social groups can foster a taste for harming members of the outside group, which can obviously be costly for society.

Envy may also fail to motivate the disadvantaged if they do not believe that greater effort has a reasonable chance of improving their situation. A compelling body of new research, emerging at the intersection of neuroscience and behavioural economics, points to the crucial role of belief in success.

For example, what appears to be lack of effort or persistence may in fact be the effect of a belief that one is either successful immediately or else has no chance of success. Outside the lab, it may be quite rational for individuals from poor families to assume there is a weaker link between effort and success, if they believe their parents or peers have worked hard and yet are still disadvantaged. People from rich backgrounds will in turn be more likely to put their advantages down to hard work and natural ability. Even if low-income families are very envious, such beliefs could lead to a lack of motivation, not a greater drive.

We must also look beyond simple economics when it comes to assessing the effect of envy. One should not be surprised that those who are disadvantaged are unhappy with the inequality and try to eliminate disparities in income; this is the nature of envy, to subvert the conditions that generate it. Envy even shows up in brain scans as a negative experience, according to recent evidence, just as high status is experienced as enjoyable.

This means we may need to account for the impacts of inequality on well-being or happiness, not just on economic outcomes. A large body of evidence from both brain scans and behavioural economics has now demonstrated that the unhappiness associated with being left behind is greater than the pleasure of getting ahead. Inequality, therefore, may have a negative impact on overall well-being in society, even if it does aid economic growth.

Of course, the “right” level of inequality will always be a subject for debate, but the idea that envy is necessarily an engine for economic progress should be accepted only with the strong caveats.

While envy might make some of us richer, it won’t make all of us happier.