You have to understand things from his perspective. He has been through things, seen things, that he wishes he never had. He’s been broken in so many ways. At this point he would rather break himself than allow someone else to come along and tear him apart.
He knew she was there to pick up his pieces instead of stomping on them. As soon as she started to collect them, he began to hide himself. He turned and tried to slam the door, not meaning for it to affect her so much. She had become an addiction to him, so he often left the door open a crack. She could still come in, but only on his terms.
You see, he saw only good in her. He thought that if he kept her, he would make her impure. He loved her so deeply that he just couldn’t get himself to ruin her. She was aware of the risks she was taking, but he wouldn’t allow her to fully take them. He saw it as risking and destroying himself to save her. She saw it as him running away from his feelings and the love filled connection he felt. He was terrified that he would screw up and break his happiness; her. Instead of doing everything in his power to keep that from happening, he turned her away. He caused her more pain than he planned. Now he spends every day feeling worse because of what he put her through. In his eyes, he’s not worthy of her unconditional love. She’s still holding enough hope for them both.