The problem mostly arises in English. I speak several other languages and all of them have a separate word for doctor(phD) and doctor(healer or whatever). I never understood why it is that way in english.
Prior to the start of modern medicine there was massive distrust with anyone who tried to treat people, as many of these were scams. When MDs started to actually understand health they started cooping the term doctor to instill trust since people knew that meant the person had been professionally educated, then they also managed to get laws passed so while anyone could call themselves a healer, only trained professionals could call themselves MDs. Eventually, doctor came to mean MD in English instead of PhD.
There's the same confusion in French and Spanish, that's a lot of people covered already. In English there's physician (which Latin people will confuse with physicist), in French there's médecin and médico in Spanish, to avoid the ambiguity.