Phillippines vs. Filipino

Why is the country spelled Phillipines but the inhabitants spelled Filipino? Is it a masculine/feminine thing?

More likely, the name of the country entered English while it was a colony of Spain, dating to the sixteenth century, but the name of a citizen only entered English after the U.S. took over the islands, which occurred after the Spanish-speaking people undertook a spelling simplification/reform that substituted F for Ph.

(This is a WAG, but I do know that Filipino in English dates to the time of the Spanish-American War.)

The Spanish name is Las Filipinas or Las Islas Filipinas. It was named after a king of Spain, called in modern Spanish “Filepe Segundo”, and in English “Philip II”.

My question is why the islands are called “Filipinas” in Spanish and not “Felipinas”. I’m wondering if he was called Filipe in his own lifetime, and if Felipe is a more modern form. Philip II was also king of Portugal, and in modern Portuguese the name is “Filipe”, so that might have something to do with it.