I purposely gave my friend a peanut butter sandwich even though they have a peanut allergy.
That's horrible. Why did you give him a peanut butter sandwich?
I thought I was doing him a favor.
It can be dangerous to give your friend a peanut butter sandwich when he is allergic, he could die. You could get in trouble with the law if something happens to him. Make your friend a sandwich of things he is allowed to eat.
I think that eating it might get rid of his allergy.
That is not the way allergies work. He could die or be disabled if you give him something that has peanuts.