Why are some people called 'doctors' even though they are not medical doctors?

Inall cases 'Doctor' is a title which goes along withhaving attainedthedegree of doctor in some field of study. Medical Doctors have the degree of Doctor of Medicine, but other kinds of Doctor may have the degree of Doctor of Laws, Doctor of Philosophy, Doctor of Pharmacy, Doctor of Veterinary Medicine, Doctor of Theology and so on.