O. Henry is expressing the opinion that Jim and Della showed great wisdom in their choice of priorities. They had very little income, clothing that needed to be repaired or replaced, an apartment with shabby furniture and a broken mirror. Their most valuable material possessions were Jim's heirloom watch and Della's fabulously long hair.
Beyond material things, however, they had each other and the deep love they shared. The value of this attachment exceeded the worth of the watch, the hair, everything physical that they possessed. They recognized and treasured each other above all else, and were wise enough to willingly sacrifice their most prized treasures in order to celebrate their love for the other. This is the wisdom to which O. Henry is referring.
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.