Jim and Della are wise because of their reaction to finding out their spouse could not appreciate their gift. They are foolish because each sold his sentimentally valuable possession for one with monetary value.
James sells his watch to buy a set of combs for Della’s hair, and Della sells her hair to buy a chain for Jim’s watch. Both gifts end up being meaningless, but the couple appreciates the thought.
The narrator compares the young couple to the Magi, who brought gifts to baby Jesus.
Being wise, their gifts were no doubt wise ones, possibly bearing the privilege of exchange in case of duplication. (p. 6)
The implication is that the gift-givers in the story are wise in their own way, because they were giving to someone they loved. Because Jim and Della “most unwisely sacrificed for each other the greatest treasures of their house” (p. 6), they demonstrated their love to each other. That was the way they were wise.