Specifically, the king effectively eliminates the young man as a suitor for the princess. Regardless of which door the young man selects, he can no longer pursue the princess. The king seeks a more appropriate suitor, someone of royal blood.
Generally speaking, the king enjoys a reputation of being fair because his people believe the system is "an agent of poetic justice, in which crime was punished, or virtue rewarded, by the decrees of an impartial and incorruptible chance," according to the story. Having the opportunity of choosing a door, however, merely gives the illusion of justice and completely absolves the king of any responsibility. It's a win-win situation for the king.