The Bible doesn't tell us why, it only records what happened between the two brothers. We can suggest a few reasons as to why Cain might have hated Abel. But these are only suggestions.
It seems unlikely that at the time when God rejected Cain’s sacrifice, Cain suddenly began to hate Abel. Hatred which leads to murder grows and grows over time. Was this a case of sibling rivalry? Perhaps. Maybe Cain felt God loved Abel more and simply hated Abel because of it. We don’t know.
It’s interesting the Bible does not record that Cain was surprised or fearful when God talked to him. This implies God had previously talked with Cain before this event. Based on past experience with God, Cain should have been familiar with God’s loving, wise character. When God spoke to Cain, He was trying to help him.
Genesis 4:4-6 (NIV, italics added), “Then the LORD said to Cain, ‘Why are you angry? Why is your face downcast? If you do what is right, will you not be accepted? But if you do not do what is right, sin (a sin-offering or animal) is crouching at your door (ready for you to sacrifice); it desires to have you, but you must rule over it.’” As a good parent, God was cautioning Cain and teaching him the correct thing to do. God wasn’t angry or punishing.
Therefore, it seems likely that Cain already harbored resentment toward Abel. This experience was simply the last straw. Cain’s anger with his brother had developed to the point of murder.