Most of us who have read and understood the books agree that this was a ridiculous decision, considering how horrible Snape was to Harry and his friends (as well as how many people were genuinely good to Harry and would have been a much better choice). We all recognize how crazy it is for Harry to name his kid after this man, but I want to take a minute to consider why he made that decision. It wasn’t Harry being stupid or Jo being careless. Rather, it is hugely indicative of who he is as a person.
Harry is amazingly forgiving. Dudley tormented him every day of his life, and all it took was for him to say “I don’t think you’re a waste of space” for Harry to forgive him. Ron acted like a jealous idiot in Goblet of Fire, and Harry didn’t even let him get the words “I’m sorry” out before he forgave him. Draco was horrible to him throughout all of Hogwarts, but he started to lower his wand when he was pointing it at Dumbledore, and Harry believed he wouldn’t have done it, and he forgave him.
Snape loved his mother. Dangerously, selfishly, but he loved her. And he acted on the side of good for her. This was enough for Harry to forgive him for the horrible way he treated him. This was enough for Harry to understand that this man spent his life terribly alone, always fighting for the woman he loved, even after she died. And Harry watched Snape die, knowing that he died a villain in the eyes of the Wizarding World. Harry was able to forgive him enough to see that he was hated when he lived and hated when he died, and because Harry is sweetheart who believes in redemption and second chances, he wanted to do something to show that he appreciated everything Snape did. Choosing Severus for his child’s middle name served as a nod to Snape, as well as a way to show the public that he believes in his goodness.
It’s a messed up, twisted way of thinking, but that’s who Harry is. He believes in good, and he believes in forgiveness, and he didn’t want Snape’s sacrifices to go unnoticed.