Absolutely, always, unequivocally earned, if you are talking about full respect. A modicum of respect should be given to everyone, unless and until they prove themselves unworthy. But to really respect someone, you must allow them to earn it.
I agree with MaryJo. There is that small amount of respect you give to others because they are your fellow human beings. Treating them as you yourself would want to be treated. But full respect for the person, as a known individual, to you, is earned.
If you wanna do the right thing, we should give it automatically because it makes us better as a person. But with how rude and trashy alot of people are, it's no wonder we don't. People are just not as respectful and have no manners as they used to be.