The dismissal was too severe a measure," the district court in Leeuwarden, in the north of the Netherlands, said in a written judgment.
"It is just a slice of cheese."
A written warning would have been a more appropriate punishment, said the court, which ordered the fast-food chain to pay the worker the salary for the remaining five months of her contract - a total of 4,265.47 euros (£3,660).
The company was also ordered to pay court costs.
The worker was fired at a McDonald's branch in the northern town of Lemmer in March last year for giving a colleague on a break a more expensive cheese burger instead of the hamburger she had paid for.
McDonald's claimed she had broken the rules, which prohibit any free gifts to family, friends or colleagues.
The decision came days after the fast-food chain reported an increase in net profits by almost 25 per cent in the last quarter of 2009.