Dinah had it exactly right in her comment to the last post: the epilogue is thematically essential because it shows us Harry as a father. To see why, I’d like to flip that post around. Instead of talking about the children, let’s look at what Rowling thinks of parents.
The answer is simple: parents should protect their children at almost any cost. That means both guarding them from danger and making sure they inherit a good world to live in. Remus Lupin posthumously expresses this philosophy well in the Resurrection Stone scene. Harry has apologized that Lupin died so shortly after becoming a father, but Lupin responds:
“I am sorry too,” said Lupin. “Sorry I will never know him … but he will know why I died and I hope he will understand. I was trying to make a world in which he could live a happier life.
(Rowling is careful in the epilogue to reassure us that Remus’s hopes for his son Teddy are not in vain. Not only is he reported to be “snogging” Victoire Weasley, but Harry notes that Teddy “already comes round for dinner about four times a week.” Teddy, his generation’s orphan among the main characters, is clearly being well looked-after by his parents’ friends.)
Centrally, James and Lily Potter do much the same. In the inciting incident, of course, they both give their lives to protect Harry. We learn later on that his mother’s sacrifice, in particular, is precisely what protected Harry from Voldemort’s curse. Even before Voldemort’s attack, though, the Potters (both the previously slightly callow James and the gentle Lily) have already made the same choice as Lupin: they will place themselves at risk so that Harry can grow up in a better world. Their courage and selflessness—both focused on their son—are one of the moral cores of the series.
It’s a model often repeated. Again and again, good characters who are parents are often good parents: they protect their children at great personal peril. Like James and Lily, Harry’s surrogate parents Remus and Sirius both give their lives protecting Harry from the Death Eaters. Molly Weasley memorably charges into battle with Bellatrix Lestrange with the words “NOT MY DAUGHTER, YOU BITCH!” She follows up by declaring “You — will — never — touch — our — children — again!”
Even more telling than these heroic examples, though, are cases in which more ambiguous characters face the fundamental question of what kind of parents they will be. There are some striking trends. Bad characters can be at least partially redeemed by being good parents, and even some surprisingly bad behavior can be forgiven if done in the service of protecting one’s children. A few noteworthy examples:
The Malfoys are figures of nearly pure badness through the first five novels. But Lucius and Narcissa are concerned parents who want what is best for Draco (even if their sense of “what is best” includes a world free of Mudbloods). In book six, Narcissa is so concerned for Draco’s safety (Voldemort has ordered him to kill Dumbledore) that she violates Voldemort’s orders and extracts an Unbreakable Vow from Snape to protect Draco from harm. In the climax of book seven, she is so concerned for Draco that she lies to Voldemort and says that Harry is dead after Harry tells her that Draco is alive and in Hogwarts. The Malfoys thus move from Bad to Neutral; they are neither victors nor defeated in the celebration after Voldemort’s death. We are meant to understand that Narcissa made the right choice, and perhaps that Draco has been a bit redeemed by it. (In the epilogue, he is a parent as well, and “nod[s] curtly” to Harry. Lucius would not have deigned to notice.)
Or consider Xenophilius Lovegood, the eccentric half-crackpot. He tries to betray Harry to the Death Eaters, but it comes out that he does so because they have imprisoned his daughter Luna and he will try any scheme he can think of to bargain for her release. Harry and his friends, understanding that Xenophilius is doing something wrong but for an understandable reason, arrange matters so that the Death Eaters will not retaliate against Xenophilius after they make their escape.
More examples, perhaps? Dumbledore’s father was imprisoned in Azkaban, but his crime was seeking revenge on the Muggles who attacked his daughter. Barty Crouch—ultimately driven mad and killed by the same son he helped smuggle out of Azkaban? In Sirius Black’s words, “Should have spent a bit more time at home with his family, shouldn’t he? Ought to have left the office early once in a while … gotten to know his own son.” Tom Marvolo Riddle’s family was a nightmare of dysfunction.
If, as I’ve been arguing, Rowling is using the series to defend this standard of parental love, the epilogue is essential. We get to see Harry grown up and a father—and thus to see him being the right sort of parent. (Notice, for example how he takes his younger son aside to reassure him not to worry about being Sorted into Slytherin House, both because there are good Slytherins and because the Sorting Hat will know not to.) This scene closes the loop. Harry is fulfilling the duties of a good person by being a good parent. This, more than Harry’s own happy state, is the biggest point of the epilogue. A natural balance has been restored, and we see wizards and witches whose parents nurtured and protected them carrying on the tradition by doing the same for their own children.