You've made a few statements here that all get to the same point: Diana's family somehow outranks Philips.
Your whole argument though is hinged on some kind of ludicrous omissions though.
1. The title Duke of Edinburgh was first created in 1726, the title Earl of Spencer was first created in 1765. So actually, Duke of Edinburgh is an older title than Earl Spencer, if we're being technical.
2. The title Duke is higher than the title Earl, so the lowest ranked Duke is higher than the highest ranked Earl (with the exception of the Earl of Wessex). So even if he wasn't an HRH, Philip would have still been higher than the Spencers.
3. Philip was created a British Prince in 1953, but that's not how he became a royal. He was born a royal. He is the only son of the son of a King of Greece, who himself was the son of a King of Denmark. Philip has Royal ancestors on both sides of his family, and they are all very close and recent relatives - including the fact that his grandfather was a king, his uncle was a king, 3 of his cousins were kings, and 1 of his cousins was a queen consort.
4. Philip's marriage is not and has never been morganatic. This is for two reasons; first, morganatic marriage does not exist, nor has it ever existed, within Britain; and second, because at no point was Philip not an equal match to his wife. He gave up his foreign titles sure (although there is no indication that he did so legally), but that didn't make him less a royal.
5. Finally, while being a Prince of Greece may not be an older title than being an Earl of Spencer, Philip is a male-line descendant of Christian IX of Denmark, whose line and title goes a fair ways further back than the Spencers do. The Spencers were mere knights when Christian IX's ancestor, Christian I, ruled Denmark.