PhD (or Ph. D.) is a bit of a frozen expression or idiom. The expression doesn't abbreviate the English phrase "Doctor of Philosophy". If it did, then it would be something like "DP" or "DoP". Instead, PhD retains the structure of the medieval Latin Philosophiae Doctor, which dates from the 17th century.
As to why the Latin abbreviation for "Philosophiae" was "Ph" rather than just "P"? "Philosophia" was a word borrowed into Latin from the Greek, and in Greek the word is spelled "φιλοσοφία", the first letter being φ. In Greek that's a single letter representing an aspirated π, and is transliterated into Latin as ph.
Since the abbreviation PhD does not match up with the English phrase it supposedly abbreviates, the pronunciation of the abbreviation has diverged from the pronunciation of the phrase.