Harry is not, and never has been, a saint. Like Snape, he is flawed and mortal. Harry’s faults are primarily anger and occasional arrogance. On this occasion, he is very angry and acts accordingly. He is also in an extreme situation, and attempting to defend somebody very good against a violent and murderous opponent.