Where exactly did the hard "P" pronunciation come from? And why do we use two different names to refer to the Biblical-era Philistines and the modern Palestinians, when the name they call themselves sounds much closer to the former?
The modern inhabitants of Israel are not related to Philistines, as far as anyone can tell. The modern Palestinians are actually related to Jews genetically, and may be holdovers of the Jewish inhabitants of the land who converted over time and mixed with other peoples of the Arab world. Jews, in turn, appear to have arisen less likely through conquest of Canaan (the land of modern Israel) but through a sort of replacement of Canaan through either some kind of revolt or some kind of gradual shift towards the Jewish faith.
Hebrew has a different pronunciation of the two groups as well. The Philistines are sometimes called "Plishtim", while Palestinians are "Palestinaim". The Philistines were not Semitic peoples.
The hard "P" is a separate issue, and one I'm not well versed on. But the Biblical-era Philistines are a separate people from modern Palestinians, a national group who gained a national identity and some ethnic differentiation in more modern/recent times. That's why they're called differently. Furthermore, there is muddying around who is a Palestinian, as the term itself is relatively modernly applied to the Arab inhabitants of modern Israel/Palestine, but Jewish inhabitants of the land used to also be referred to as Palestinians in the past two centuries or so, while that has changed with the re-creation of Israel in its modern iteration. Immanuel Kant, the philosopher, even referred to European Jews as "Palestinians", and the founders of Israel debated calling the country "Filastin" in Arabic. Zionists became more reluctant to call themselves Palestinians over time, to distinguish themselves from Arab Palestinians and the Palestinian national movement, which became an even clearer distinction as Palestinian groups like the PLO described the Palestinian people as those of Arab descent and any Jew who lived in the area prior to the 1880s or so, which is an indistinguishable group at this point for the most part and therefore provides no inkling of who is a "Palestinian Jew".
u/tayaravaknin gave a great account of the social issues involved, so I'm just going to talk about the history of biblical transliteration (representing a language with a different alphabet).
In biblical Hebrew grammar, the letter at the beginning of the word "Philistine" is pronounced "p" at the beginning of words or syllables and "f" when it follows a vowel. There is no such letter in most other languages, so in the Greek version of the Hebrew bible it's spelled with the "ph" letter. In Roman translations of Greek sources, that letter often morphs into a regular "p," and that seems to be what happened here. The Roman province in that region was called Syria Palaestina, and that was maintained in the English "Palestine." But the biblical word was still more closely linked to the Greek bible, so it stayed "Philistine."
Meanwhile, Arabic is a semitic language, so it has actual cognate letters to Hebrew and to the ancient semitic languages spoken around the time the bible was written. And in Arabic, the cognate to that letter that is "p/f" just makes the sound "f" regardless of its place in the word. So that ancient word is pronounced "Filastini" in Arabic.