Why do I still care about someone who rejected and hurt me so much?

Me 26, a master's student,
Living in private accommodation shared a flat with a Chinese girl.
We become the best friends.
I fell in love she didn't, I told her, she rejected, we still were the best friends.
Then she started feeling scared around me as I had feelings. She fought with me that she made a mistake even being a friend to me.
I explained it's not like that.
She still did that to me.
It took me 2-3 months to get rid of my feelings living just 2 doors down the hall.
I was a-okay, I started improving.
And then last week she fell down , hurt her hand, then it got infected.
She went to the hospital, got dressing for the wound.
The day I saw the cover and the hand carrier (it looked like her arm was broken)
I tried to ask what happened she told me everything.
The same day she asked me to help her to change the dressing on her wound.
That was a surprise as she feels unsafe around me.
I felt guilty, angry, felt bad, it feels like I should have been with her to keep her safe.
She rejected me, but why I feel like this.
Why I still care about what happens to her.
She said a lot of mean, dehumanising things to me.
But why I want to forget everything what she did and mend my friendship.
At the same time I don't want to forgive her as she hurted me too much.
I losing sleep on this I feel guilty that I made someone feel unsafe one time.
I am losing my sleep because why did she had to get hurt.
Why can't it be someone else who I don't had to care about.
Why do I have to love someone who never will be with me (her words).
But again I want to forgive her and having that fucking hope to get at least the love in friendship I was getting.
Why do I still care about someone who rejected and hurt me so much?
Post Opinion