I have never found a good explanation as to what Hevel did wrong that elicited his being killed at the hands of Kayin. It may be that the whole question is out of place, as a ba’al bechira has free reign to cause harm even without an overt decree against the victim (see here for a diyuk in next week's parsha to that effect and here, here, and here for more). That answer, though, is far from satisfying.
In the sefer “M’Shulchan R’ Eliyahu Baruch,” collected from the shiurim of R’ Eliyahu Baruch Finkel of the Mir, he notes that when Kayin was dejected and deflated by Hashem’s rejection of his korban, Hashem reacted by offering Kayin words of encouragement, demonstrating the midah of being nosei b’ol chaveiro, showing empathy for the plight of others. This is one of the overlooked lessons of the parsha. He then suggests an even bigger chiddush. Hevel knew his brother was suffering, and yet Hevel said nothing and did nothing to alleviate Kayin’s pain. Perhaps it was because of this indifference, this lack of empathy, that Hevel suffered death.
(Of course I don't know where it says that lacking empathy means you are deserving of death. Maybe it just means that Hevel didn't deserve any protection of hashgacha because of his moral failure.)