Before starting any prayer it is required that we light a lamp which is made up of oil and cotton wick. But it is considered uttam (best) if ghee (Clarified butter) is used instead of oil. Why is ghee considered uttam?
As you pointed 'ghee' is considered as the best for lighting lamps in houses and also in temples. This is the product extracted from milk of cows, which is considered sacred. Ghee is one of the purest form of milk which is extracted from the butter. As we all know cow milk has some medicinal qualities. Since ghee is the purest form of milk, it will have it's highest qualities. When we use ghee lamp it helps to purify the atmosphere.
The following information is taken from this reference
Lamps / Diya we say have special meaning in Hindu dharma.
Lightness is a symbol of knowledge which in a way removes ignorance amongst humans, just as light removes darkness.
Since old days, people lit lamps around their homes, in temples etc just to ignore darkness because some people relate darkness with evil spirits, bad demons etc.
Some ignore doing (shubh) [Good] (karya) [work] in darkness, and hence they do it in the early morning (when there's light[prakash])
I would like to share a snippet from Sanskrit
Here, the sentence I have highlighted is pronounced as "Tamso maa jyotir gamaya" which means From darkness, lead me to light.
Now why do we use Ghee and why not candles? Ghee which is made out of cows milk is preferred or in your words, its considered as uttam as it spreads vibrations which helps human talk with Gods and Godesses.
There is a difference between lighting a lamp with ghee, oil and candles, I already explained you about the ghee, but when one lits the lamp with oil, it spreads the vibration which helps you talk with your ancestors.
And the one which lits up with candles spreads vibrations which helps one communicate with Evil spirits(Demons). Hence when you see, some people do black magic tricks to interact with the souls (Aatma) they use candles while doing so.
Also, as far as I remember, recently I visited Tirupati mandir, where they still don't use artificial lights in the inner main room where they've kept lord Tirupati's murthi, they use diya instead which is nothing but a natural form of light.
To support my answer, I would like to link to a similar article which has similar views over this and is covered in detail
I have heard that if you light a desi ghee and saffron diya the illness goes away ?