HARRY: It seems, despite your exhaustive defensive strategies, you still have a bit of a security problem, Headmaster. I'm afraid it's quite extensive. How dare you stand where he stood. Tell them how it happened that night. Tell them how you looked him in the eye, a man who trusted you, and killed him. Tell them.
At this point, Harry still doesn't know that Snape is actually secretly working for his side, and thinks that Snape killed Dumbledore to please Voldemort, so he's not seeing Snape as super brave or awesome right about now.
LILY: You've been so brave, sweetheart.
Right before Harry goes to sacrifice himself (i.e., let Voldemort kill him), he uses the Resurrection Stone to say hey to some of his departed friends and relatives. They give him a pep talk before he heads out, and his mother and father are super proud of him.
VOLDEMORT: Harry Potter: the "Boy Who Lived." Come to die. Avada Kedavra!
Yup, Harry actually did it: He just walked up to Voldemort and let the Dark Lord aim the Killing Curse at him. Not even an "Expelliarmus" to try to defend himself. We can't even fathom how much courage that would take (and hope we never have to find out—Dark wizards terrify us).
DUMBLEDORE: Harry, you wonderful boy. You brave, brave man!
After Harry bites the bullet and lets Voldemort take him out with the Killing Curse, he ends up in some kind of limbo—where he gets a pep talk from Dumbledore. (He's back from the dead—just go with it.) Like everyone else, the headmaster is super impressed that Harry was willing to sacrifice himself to save everyone else.
VOLDEMORT: Well, I must say, I'd hoped for better. And who might you be, young man?
NEVILLE: Neville Longbottom.
VOLDEMORT: Well, Neville, I'm sure we can find a place for you in our rank.
NEVILLE: I'd like to say something.
VOLDEMORT: Well, Neville, I'm sure we'd all be fascinated to hear what you have to say.
NEVILLE: Doesn't matter that Harry's gone.
Harry isn't actually dead, but Neville and Voldemort don't know that yet—and we have to say, we think it's super gutsy of Neville to stand up to Voldemort and basically say he's not planning to give up on the fight, just because their leader is dead. Remember sweet, meek Neville from the earlier films? Yeah, neither do we.
HARRY: Albus Severus Potter, you were named after two Headmasters of Hogwarts. One of them was a Slytherin, and he was the bravest man I've ever known.
As you can see here, Harry has changed his tune about Snape a lot by the time he has his own children—he even names one of them after his least favorite teacher ever. But as Harry now knows, Snape took humongous risks and ultimately died working to defeat the Dark Lord and keep Harry safe.
So, yeah, even though they never got along in life, it seems fitting that Harry would name his son after Snape, we suppose.