In most ways HIMYM is a subversion of all those shows.
First of all young lad, TV has never had happy heterosexual family life.
In the 50s, there was no hetrosexuality because there was no sex - it was the 50s.
In the 60s single parent family was the norm, but because divorce was still taboo, and women weren't allowed jobs, the message sent was - Your mom's gonna die, kid!
In the 70s changing mores introduced the disappeared dad, simgle mother - lesson men are jerks.
In the 80s you had Roseanne and families who stayed even though they shouldn't - marriage is a mistake.
The 90s added to that with Sienfield and yes, even Friends when single is the dream, when you marry it's over.
On HIMYM, despite all the characters (except Marshall, but he's from Minnesota) coming from Divorced or Dysfunctional 70s and 80s TV families, happy heterosexual family life is not the end, it's the goal.
The character, Ted, is demanding perhaps too much perfection, and ironically will end up the last to marry
Ted: What if Cindy is the woman I'm supposed to marry and I'm just giving up? So long, elegant yet welcoming home in Westchester, with a sensible mortgage I can handle without dipping into my savings! Bye-bye, two kids I raised with a stern yet loving hand, finding the perfect balance between father and friend! Adios, triplet schnauzers Frank, Lloyd, and Wright—But as the flashback format of the show shows, in 2030 he has all that.Marshall, Lily, Robin: TED!!
Marshall and Lily who were less picky and settled for the the first person of the opposite sex they met in college are well on the way to recreating the family Marshall had in St Cloud, Minnesota - although perhaps not with the wife 15 year old Marshall wanted in his letter to his future self
Fifteen-year-old-Marshall: Your wife, let me break it down for you, dude. Your wife, blonde, six feet tall, huge rack, and she caters to your every whim.Yeah, perhaps not exactly family viewing, but Marshall reached for someone better, and Lily settled for someone who is definitely not her deadbeat dad, so it's all good.
Marshall: Sorry, baby.
Lily (none of that): That's okay. You just described your mother.