Why is Severus Snape an antihero

Well, Severus Snape is neither black nor white. It is gray.
He has good and bad qualities, but everyone has them.
How did Sirius say so beautifully? We all have a light and a dark side, it depends on which side we choose to act.
Harry Potter is far from perfect either. He also makes mistakes.
I wouldn't call Severus a "hero", rather an anti-hero.
He was a Death Eater and must have done some things that weren't okay. He only switched sides because of Lily and not because he saw his mistakes, or because he realizes that Voldemort is not doing the right thing after all.
But after switching sides, for whatever reason, he protected the students at Hogwarts and, above all, often saved Harry's neck. The oh-so-great hero wouldn't even have survived the first book without Severus.
Certainly he behaves wrongly with the students, no question about it, but when you think about how his own childhood was, arguing parents, probably also violence and then the bullying in school. Well that all leaves its mark.
Of course he wasn't innocent at school either, but the Marauders started, you can see that in the scene on the train. That came from them, not Severus necessarily.
Then the Slytherins are all condemned, you can see that wonderfully in the book. I doubt it was any different in Snape's day and the teachers seem to have looked the other way when it comes to bullying. One can understand why Snape became the way he was.
He has protected the people he personally does not like and shows incredible courage, which even Harry sees in the end and if even Harry Severus can forgive his bad deeds, then there is probably something to it;)
Besides, Albus Dumbledore is far from perfect either. Nobody is perfect in the book series and I think this is from J.K. Rowling intended that too.

So to me Severus is an anti-hero and I agree with Harry in his statement that he was / is the bravest man.
Because without him the war could not have been won, you can say what you want.