Bf said he hated me during small argument

We got into a small disagreement before bed because I was on my phone while he was trying to sleep. My phone had NO volume btw. But he said my phone “light” was bothering him. My brightness was on low and he was facing the OTHER way. I told him that it’s never been an issue so why is it now? And he just said oh my God I hate you!! And turned around and went to bed. Like who even says that when they’re mad? Over the tiniest disagreement too! An hour later he said I love you.

Why do people say hurtful things when irritated? I’ve never said that no matter how mad. Words actually do affect you and it makes me question everything. We’re long term & I wanted to marry this man. Now I’m left questioning whether to be with him.