The moral lesson in the story "The Gift of the Magi" is that people are willing to give up what means the most to them for the person they love. In the story, the couple acts on impulse as each strives to please their spouse.
Both the husband and wife in the story want to buy their love a meaningful Christmas gift, so they sell their most prized possessions. They do not consider the consequences of their actions as they are determined to make the other person happy.
The story was written by O. Henry and was published in 1905; it first appeared in The New York Sunday World.