The friendship between Amir and Hassan is, indeed, a major element of the novel. Amir’s need to maintain some distance from Hassan is present throughout the story of their friendship as Amir narrates his childhood history growing up in Afghanistan.
The primary reason that Amir seems to want to maintain this distance from Hassan is Amir’s need to secure affection and intimacy with his father. Amir feels that he is trapped, in ways he cannot fully understand, in a competition with Hassan for Baba’s admiration and affection.
The friendship between Hassan and Amir is almost like a brotherhood as it is described in the first half of the novel. Returning to his home town years later, Amir discovers that he and Hassan are actually brothers. They share the same father – Baba.
Your father was a man torn between two halves, Rahim Khan had said in his letter.
This revelation helps to explain some of the preference that Baba always showed to Hassan (according to Amir’s childhood views) and so explains why Amir felt that he had to maintain some formal superiority to Hassan as a child. Amir suspected that Baba’s bond with Hassan was greater than the one he shared with Amir.
“Living in a single-parent home, Amir yearns for his father’s attention and gets jealous of Hassan when his father bestows favors on Hassan, favors like arranging cosmetic surgery for his harelip” (eNotes).
Amir’s need to keep a distance between himself and Hassan then can be seen as a response to the difficulties that Amir faced in his relationship to his father. Baba was not proud of Amir (the bookish and morally weaker of the two boys) in the same ways that he was proud of Hassan (the athletic and brave one). Amir relied on the social distinctions that separated him from Hassan and the educational distinctions that resulted therein.
There are a two reasons why there seems to be a chasm separating Amir and Hassan.
One of these reasons is the social divide between the two. Hassan is a poor boy from the lowest social class while Amir is from a rich privileged family. And while a prince and a pauper can be friends it is shown in the book several times that Amir feels embarrassed to be seen in public with Hassan. Also, Hassan is a servant to Amir and Amir will often treat Hassan in a condescending manner and act as his superior.
The second reason is Hassan's angelic nature. Although Hassan is a servant, he works hard and rarely complains. He is fiercely loyal and brave to Amir. However, when confronted Amir deserts Hassan because he is too scared. Because of this he feels immense guilt when with Hassan and instead of taking responsibility he blames Hassan for this guilt.