At the risk of giving Phil's parents too much credit, it's possible they pushed him to do well in high school. I don't think it's a stretch to say they were far from the greatest parents in the world, but it doesn't mean they were completely absentee and only ever spoiled him. We just have very limited knowledge of them, especially from the younger Phil years.
As others pointed out earlier in the thread, getting valedictorian in a small school isn't exactly the hardest thing in the world, especially when said school is primarily known for pumping out athletes. One of my friends graduated from a private school with a class of like, 20 something and was ranked as the 2nd or 3rd highest, despite frequently skipping classes and barely trying. As far as we know, DSP didn't have much of a social life or anything, and while his critical thinking and analytical skills have been shot for at least the last 10 or so years, I think a lot of that has to do with the way he developed his lifestyle. I'm not saying the dude was smart or anything back in the day, but a younger Phil could probably retain information better than current age Phil who let his brain atrophy.
It's basically the 4th place win all over again. Phil was playing a game barely anyone played, aka going to a small school. He memorized a few broken combos and got to the top, aka sat at home before tests and memorized the material because most high school teachers hand you everything you need to know. The difference is with SF, there were a few other people who actually cared about coming out on top. In Phil's tiny school, they were more concerned with basketball. If Phil went to a more traditionally sized school, there's probably no way he gets valedictorian.