The short answer is that he's not. Amir is the protagonist of Khaled Hosseini's The Kite Runner, but he certainly does not portray the most heroic characteristics. The reason why Amir is the "hero," is that it's more interesting for a reader to follow a flawed character than a great one. When we read a book, we mostly do it out of a desire to go along with someone on a journey. As a result, protagonists are often people who are missing something, which in Amir's case is confidence and redemption.
When you compare the two characters, Hassan absolutely comes off better and more suitable to be the hero. He is kind, loyal and strong; whereas Amir is a petty, cowardly person who struggles to stand up for what is right for most of the novel. Therein is the answer, however. Hassan is already at the end of his character development as the story begins. He doesn't change a lot, with the exception of becoming sadder. Amir, on the contrary, is only at the beginning, making him the logical focal point of the tale.
On the other hand, you could argue whether a true hero is someone who is born good or someone who becomes good through their own efforts. Hassan is an example of the former: ever since he was a little boy, he always followed his conscience and never allowed the unfair society to tell him otherwise. Several times throughout the novel, he is shown to be brave in situations that would daunt others, but Hassan never even thinks of shrinking back. Amir, by contrast, becomes the latter type of hero. Being self-preserving and selfish at first, Amir grows into a man who puts his own life on the line to save Hassan's son. In a way, then, Hassan never strays from the good path, but Amir is the only one who actively makes the choice to "be good again." Everyone might not agree, but that is definitely an argument you could make for Amir's case as the true hero of the story.
In a more general sense, Hassan is the true hero of life, but Amir is the natural hero of a novel.
Amir is the novel's protagonist, who experiences extreme guilt as a child after he refuses to intervene while his best friend is being raped by Assef. Amir lives with the guilt of neglecting Hassan and struggles with his repressed emotions as an adult. Amir demonstrates his heroic qualities later in life after he receives a call from Rahim Khan and travels to Pakistan to learn how he can atone for his past sins. After learning that Hassan was his half-brother and has a son named Sohrab, who is living as an orphan in Kabul, Amir decides to rescue Sohrab from a difficult, dangerous life.
Amir sacrifices everything to travel into the Taliban controlled country of Afghanistan, where he ends up fighting Assef in order to save Sohrab and atone for his past sins. Amir almost dies during the fight but successfully saves Sohrab's life. Amir once again demonstrates his heroic nature by adopting Sohrab and taking him to America. Overall, Amir is considered the true hero because he finds redemption by saving Sohrab and gives him a new chance at life in America.
The protagonist of Khaled Hosseini's novel, The Kite Runner, Amir makes up for his earlier transgressions when he returns to Afghanistan to rescue Hassan's son from the Taliban. Amir had acted cowardly in his previous treatment of Hassan (refusing to help him while being raped and planting incriminating evidence against him); however, his guilt over these transgressions haunted him continuously as an adult. When Amir learns that Hassan is actually his half-brother, and that Hassan's son, Sohrab (Amir's half-nephew) has been left behind in Afghanistan, he realizes that by rescuing the boy and returning him to America he will make amends for his earlier faults. He risks his life by just re-entering the Taliban-held territory and barely comes out alive when he frees Sohrab. These actions could certainly be called heroic, though I doubt that Amir would have considered them so.