I think respect has to be earned but also demanded at times. Sometimes our dealings with people are very brief and there is no time to earn their respect. In those instances, you have to demand respect and teach people how they are to treat you.
An example of both earned and demanded respect would be our children. I loved raising our kids and we had a ball. But we had some basic rules. My children did not raise their voices to me. I always listened to whatever they needed to say, thought things over but as their mother, I did not allow them to yell at me.
Likewise, I returned that respect and did not yell at them. They were not hard of hearing, neither am I, so there was no need to yell. We showed each other mutual respect. We earned it by our behavior, but in the beginning it was demanded by us as parents.