Why does Snape agree to protect Draco?

Harry Potter author J.K. Rowling explains: is Snape good or bad?

On Twitter, J.K. Rowling asked why Harry Potter named his son Albus Severus after an unsympathetic man like Severus Snape. And Rowling was clearly trying hard to answer.

Anyone who does not count themselves among the Potterheads and has been stirring up the Leaky Cauldron forums for information and theories about the Harry Potter series for years, the following discussion will at best make a shrug of the shoulders. In fact, since the last novel Harry Potter and the Deathly Hallows was published in 2007, two camps can be identified among readers: Snape haters and Snape fans. For some, he remained the disgusting teacher who humiliates helpless students, makes life difficult for Harry and in the finale for selfish reasons sacrifices himself for the good side. For the others, Severus Snape remained the somehow hottest teacher played by Alan Rickman, who gloriously sarcastically cleans up students, makes Harry Potter's life difficult and in the finale sacrifices himself for the good side for romantic reasons. Now Harry Potter creator J.K. Rowling himself between the fronts. On Twitter she was asked:

Why did you name Harry's child after Snape? I am seriously curious as he was nothing more than abusive towards all of his surroundings.

Albus Severus Potter appears in the epilogue of Harry Potter and the Deathly Hallows. On platform 9 3/4 he says goodbye to his parents Harry and Ginny, but is afraid of being sorted through the talking hat into the Slytherin house at Hogwarts. J.K. Rowling justifies her choice of name as follows:

Snape died for Harry out of his love for Lily [Potter]. Harry honored him as a token of forgiveness and gratitude. (Tweet)
A whole essay could be written about why Harry named his son Snape's name, but the decision essentially goes back to what defines Harry's personality after the war. (Tweet)
Snape is a gray area. You can't make him a saint: He was vengeful and a bully. You can't make the hell of him: he died to save the wizarding world. (Tweet)
In honoring Snape, Harry hoped deeply that he would forgive himself too. The dead of the Battle of Hogwarts would haunt Harry forever. (Tweet)
Snape deserves both admiration and disapproval, as do most of us. (Tweet)
Snape was a bully who loved the good in Lily but was unable to do the same. That was his tragedy. (Tweet)
Snape did not die for his "ideals". He died trying to atone for his own guilt. He could have given up his double game at any time to save himself, but he chose not to tell Voldemort that his fixation on Harry was a fatal mistake. Snape's silence ensured Harry's victory. (Tweet)
Harry decided to carry on the names of those two people who had no one in the family to do so themselves. (Tweet)

Now, of course, it can be argued whether J.K. Rowling online should really be compelled to explain her books. Since the publication of the last volume, the author has not kept secret with her judgment of her characters and occasionally reveals what happened after the end of the published story. Whether we want to know or not. In any case, we can applaud your willingness to communicate, especially with regard to your many young fans. And as for Severus Snape or Albus Severus Potter, Harry has already said everything on the subject when he calmed his offspring at the train station:

Albus Severus, you are named after two headmasters at Hogwarts. One of them was a Slytherin and he was probably the bravest man I have ever met.