After publishing Deathly Hallows, Rowling identified Teddy Lupin’s story as one of the primary reasons that she wanted to include an epilogue:
"To hear that Teddy Lupin – Lupin’s son is obviously okay. That he has an ongoing relationship with Harry and that he’s – he must be quite happy and he’s got a very good-looking girlfriend because I think he’s kissing in the epilogue his – Bill and Fleur’s eldest daughter. […] [It’s important] Because he’s been orphaned. And I want – I want to show that he’s okay.
And I want to show that because the world is a better place, he’s having a happier – and then I started to cry. So obviously Teddy Lupin’s very important to me. I just – yeah. I – having killed both his parents,
I really wanted him to be okay.” — J.K. Rowling