Etymologists say it originally meant due??o de una casa `lord, or master, of a house' and is a contraction of duen de casa .  Duen is the apocopated (cut-off) form of duemo , which stems from the Latin dominus .  As the Spanish word evolved, the de was suffixed to the duen , the casa was omitted altogether, and el duende thus became  the lord of the house. 
The origins of the word duende are shrouded in mystery and it has no known significance.