Hassan is a truly good and beautiful person even though he's had his fair share of hard times. In fact, Hassan has it tougher than Amir from the beginning. Not only did Hassan lose his mother (like Amir), his mother flat-out rejected him:
Sanaubar had taken one glance at the baby in Ali's arms, seen the cleft lip, and barked a bitter laughter. [...]. She had refused to even hold Hassan, and just five days later she was gone. (2.29-30)
But Hassan, unlike Amir, is a selfless and joy-filled creature. As Amir says, "Hassan never denied me anything," and we watch Hassan again and again think of others before himself (2.2). Hassan covers for Amir when they get in trouble. He defends Amir when the neighborhood bullies threaten them. The boy also serves Amir and Baba with the thoughtless goodwill of a saint.
Hassan gets even more saintly. When Amir betrays Hassan in the alleyway, Hassan looks up with resignation. Amir describes his expression as "[t]he look of the lamb" (7.133). Hassan's ability to suffer without becoming bitter really separates Amir and Hassan. Even years later, after being driven out of the house by Amir and losing his father to a land mine, Hassan writes letters to Amir filled with warmth and nostalgia for their time in Kabul. Somehow, Hassan never thinks to hold a grudge against Amir. It's unthinkable – it's simply not part of the makeup of this character.
Perhaps in the novel Hassan represents the good life Amir should aspire to imitate. That said, Hassan also infuriates Amir with his goodness. After Amir betrays Hassan, Hassan continues to serve Amir tirelessly. The two boys go up to the pomegranate tree and Amir begins to pelt Hassan with pomegranates. Amir calls Hassan a "coward" and begs Hassan: "Hit me back!" (8.88). Hassan just takes it and never fights back.
We're not sure what Hosseini wants us to make of Hassan's character. We certainly admire him. Maybe, in the end, Hosseini portrays the Hazaras of Afghanistan and Afghanistan itself through Hassan. Here's an ethnic minority that's been persecuted and massacred. Here's a country that's been unjustly invaded. If so, there's more than a hint of martyrdom about Hassan's people and, conversely, Hosseini's Afghanistan.