Why are the virtues of generosity and self-sacrifice more important than money as a basis for a happy marriage?
The whole story is basically a commentary on your question. In other words, the whole short story is how self-sacrifice is more important than anything else, including money, for the basis of a happy marriage. As the story progresses, both husband (Jim) and wife (Delia), a very poor couple, give up their most cherished possessions to give the other a gift. The wife gives up her hair to buy her husband a chain for his pocket watch and he sells his pocket watch to give her combs for her beautiful hair.
In the end, of course, they cannot use their gifts, as Jim has no watch on which to put on the chain, and Delia has little hair for which to use her combs. But the conclusion of the story is that this was the best Christmas.
O. Henry, the author, is able to make that claim, because in the end sacrificial love was evident. Both Delia and Jim loved not themselves but the other more. True love in actions was demonstrated. In the face of this, the pursuit of "things" is shallow. What really counts in love expressed in sacrificial actions. A relationship built on this foundation can weather any storm.