Amir was simply unable to be Hassan's true friend. Amir was filled with insecurity and self-hatred. He admired his father's courage, but felt he could never live up to it. Amir lived in great fear. Hassan, who was small and weak, fought fiercely to defend Amir from the bullies, but Amir watched silently, afraid to act, as Hassan was violently attacked by the same gang. Hassan's courage made Amir feel great shame.
As a result of these feelings, Amir was compelled to exercise his power and control over Hassan, who was a servant. Growing up, they became close companions, but they were never equals. Amir abused Hassan and treated him very cruelly because Amir felt such contempt for himself. Being mean to Hassan made Amir feel better about himself. He punished Hassan for his own self-hatred. However, when Hassan remained Amir's loving friend, despite being so mistreated, Amir's shame and guilt only increased, and his destructive behavior continued.
Amir knew he did not deserve Hassan's love and loyalty. By mistreating Hassan, Amir was subconsciously trying to drive him away. Finally, Amir does drive Hassan out of his father's house permanently when Amir can no longer live with his guilt and shame for failing to protect Hassan. For Amir, Hassan had become a constant reminder of how worthless he felt himself to be.