R. Shimon b. Yochai says: Beloved are afflictions, for three goodly gifts were given to Israel and are desired by the nations of the world, and they were given to them only through afflictions — Torah, Eretz Yisrael, and the world to come. Torah, (Mishlei 1:2) "to know wisdom and chastisement, to comprehend words of understanding," and (Psalms 94:12) "Happy is the man whom you chastise, O L–rd, and whom you teach from Your Torah." Eretz Yisrael, (Devarim 8:5) "… the L–rd your G–d chastises you … (7) for the L–rd your G–d brings you to a good land." The world to come, (Mishlei 6:23) "For a mitzvah is a lamp, and Torah, light, and the way of life, the chastisements of mussar." Which is the way which leads a man to life in the world to come? Afflictions.
Torah, Eretz Yisrael, and the World to Come
Mekhilta Tractate Bachodesh 10:10