Rashi explains that Kayin’s punishment was his loss of the privilege of dwelling continually in one place. He would always be a fugitive, running from one place to another. Kayin’s punishment seems somewhat peculiar since Hashem always punishes measure for measure. The punishment does not seem to be consistent with the transgression.
Perhaps we may suggest an answer to these questions by applying the words of the Roziner Rebbe Z”l explaining the contrasting attitudes of Kayin and Hevel in light of their professions. The pasuk states “and Hevel was – hvhu– a shepherd of sheep, and Kayin was – vhv- a tiller of the earth” (4:2). The word “hvhu” usually implies sadness, while the word “vhvu” implies happiness and joy. He explains that Hevel approached his profession with sadness, since it limited the time he could allot to the service of Hashem. Kayin, in contrast, enjoyed the time he spent working the earth. This is why Hashem accepted Hevel’s sacrifice. When one perceives that a profession is to be simply a source of income, in fulfillment of Hashem’s curse to Adam, then the fruits of his labor are truly spiritual fruits. Kayin’s perspective was, unfortunately, different. He felt that the toil in material endeavor constitutes man’s purpose in life. Hashem rejected his sacrifice, because this erroneous concept caused a jealousy so intense that Kayin killed his brother, Hevel. He was, therefore, punished measure for measure, made to move in exile from place to place. His resulting instability caused him to reflect on man’s temporary position in this physical world. This led to his realization that this world is only a vestibule for the ultimate world-to-come, which we merit only through the performance of mitzvos and good deeds.