When a player leaves a team-based game before a match is finished, it sucks. Their team will be at a major disadvantage, and for the players being brought in to fill the empty slot, joining a halfway-lost game in progress isn't much fun either.
That's why Overwatch punishes people who leave matches before they end. Doing so repeatedly will hit you with a -75% XP penalty, meaning those lovely loot boxes will come at a much, much slower pace.
But for the game's competitive mode, the XP penalty apparently isn't enough for Blizzard. The competitive mode is currently in beta, and users on Reddit have noticed some very strict sanctions for those who leave competitive matches early.
A warning message in the game (seen below) tells of bans from several matches for repeat offenders. The worst leavers might find themselves locked out of competitive mode for the full season. With seasons lasting two and a half months, that's quite the punishment.