The candle is not a sign of mourning but rather a symbolic means of honouring the deceased.
Candle light symbolizes the Divine Presence, which receives the soul as it leaves the body.
Furthermore, the immortal soul is compared to a burning light as it is written “The lamp of the Lord is the soul of man…” (proverbs 20:27)
The light of the candle drives away any destructive forces that seek to harm the body.
The soul derives benefit from the light.