Warning: TvTropes link ahead
https://tvtropes.org/pmwiki/pmwiki.php/Main/LonelyRichKid
While yes, it serves to generate empathy for the character, there's another effect.
Flash Thompson was one of the snap victims who came back during the blip. We see this confirmed in the movie where
MJ tells the flight attendant that Flash isn't technically old enough to drink alcohol because he was blipped
Part of the movie deals with the theme of how people who were affected by the Snap/Blip are trying to cope with the world as it has become 5 years later. Peter Parker and Aunt May are both actively involved in helping victims.
One of the possible effects of Flash's removal for 5 years is that, if his parents survived, they would have had to deal with the grief/loss, move on, and then suddenly have their kid back in their lives. This is a trauma that would have negative effects on all people involved, and even a rich bully like Flash isn't immune to that.
Therefore, this scene ties in rather nicely with one of the main themes of the movie.