It does have a lot to do with personality, but the Sorting Hat also looks at your legacy. Perhaps you appear to be a Hufflepuff prima facie, but the Sorting Hat knows your family has a history of Gryffindor, and it sees something deep inside you that makes you a Gryffindor. Take Neville for example. He is very much a Hufflepuff by nature, but by the end of the series, his bravery and courage is realized. That's why he was a Gryffindor, the Sorting Hat saw something in him that he was destined to become.
Personality is environmental though. You are like your parents, in one way or another. And in the wizarding world, your legacy is all you have. Your name. It is in a child's natire to want to appease and impress your parents. And the Sorting Hat gives you a choice, just as Harry tells Albus at the end of DH2. Scorpius may have the personality of a Hufflepuff, but maybe he has a destiny to be Slytherin or he just wanted his father to be proud of him and chose Slytherin.
I think the fact that Draco raises Scorpius better than Lucius or Abraxas did would make Scorpius want his father's approval even more. And no, not all children are like that, but this doesn't take place in America. These kids were raised in early 2000s Britain. And before you say that doesn't matter, it certainly does. Especially for a wizard. Children there are raised to be more proper and respectful, at least during the late '90s and early 2000s. Children were raised more proper and respectful back then. And for a young wizard pressured with the legacy of dozens of generations, it makes a huge difference.
Ah, I didn't realize he was born that late. I thought they were born shortly after the end of the Second Wizarding War, in which case they wouldn't have attended Hogwarts around 2010 or slightly later. I know what you mean about teenagers rebelling, but that usually happens after puberty, around 12-14. And that is represented in years 4 onward in the movies. But you begin attending at age 11. Usually children will still respect and honor their parents beliefs at that point. They only turn into little shits a couple years after that. Of course I think Draco cares about his kid's wishes, but it goes both ways. I think Scorpius still cares about his father's approval, and while family does matter more than legacy, your legacy is how people recognize you at first glance. That's what the Sorting Hat sees prima facie. That's why I like the Ilvermorny sorting more. Multiple houses can choose you then you can choose which ine you want. I like to believe I would be picked by at least Horned Serpent and Thunderhawk, and possibly Pukwudgie. I know I'm not a Wampus, but I get a choice in who I want to be between the other two or three.