While most market transactions are subject to strong incentives, transactions within firms are often not incentivized. We offer an explanation for this observation based on envy among agents in an otherwise standard moral hazard model with multiple agents. Envious agents suffer if other agents receive a higher wage due to random shocks to their performance measures. The necessary compensation for expected envy renders incentive provision more expensive, which generates a tendency towards flat-wage contracts. Moreover, empirical evidence suggests that social comparisons like envy are more pronounced among employees within firms than among individuals who interact only in the market. Flat-wage contracts are thus more likely to be optimal in firms than in markets.