The allusion to the Magi seems inappropriate at first to the reader. For, after all, the Magi (the Latinized form of the Greek word for magic) were a select sect of hereditary priesthood who had extraordinary religious knowledge and their gifts were of great monetary value, intended to suggest great respect and devotion. However, as the reader reflects upon the characters in the story, he/she soon realizes that Jim and Della are wealthier and more knowledgeable in the ways of love than elite priests of profound and extraordinary knowledge.
And, with the magic of true love, "two foolish children" realized more than the Magi: Ironically, they realize the most valuable gift is the gift of unselfish love.
Such as they are the wisest. Everywhere they are the wisest. They are the Magi.
According to the paragraph:
The magi, as you know, were wise men--wonderfully wise men--who brought gifts to the Babe in the manger. They invented the art of giving Christmas presents. Being wise, their gifts were no doubt wise ones, possibly bearing the privilege of exchange in case of duplication. And here I have lamely related to you the uneventful chronicle of two foolish children in a flat who most unwisely sacrificed for each other the greatest treasures of their house. But in a last word to the wise of these days let it be said that of all who give gifts these two were the wisest. O all who give and receive gifts, such as they are wisest. Everywhere they are wisest. They are the magi.
The Magi, or three wisemen, are connected with being the first givers of gifts upon the birth of Jesus. Their gifts were "wise" because each symbolized something unique to the recipient. The Gold is the symbol of kings, Gapar gave him Incense, which is the an allusion to divinity, and Balthasar gave Mirrh, which in an allusion that the Son of Man will eventually have to die.
Regardless of this, in the story, the two protagonists likewise give each other utterly symbolic gifts that represent something unique to them.
In the end, however, O.Henry refers to them as silly- but this is just a way of showing the things one does for love, and the sacrifices one must endure for others. In doing this sacrifice, they became "the wise men"- or persons of equal quality of nature, above a world much less humbled by circumstances.