With the assumption that evil exists so that we have free will and that it gives purpose to doing good (c.f. this answer), what will happen in the messianic era when there will be no evil? Can we conclude that there will be no free will or purpose to doing good in the World to Come?
But, as Dovid HaMelech wrote and alluded to above, the time will come when both the spiritual AND physical life will become simple, in the days of Moshiach, when there will no longer be a yetzer hara to confront us and make us rationalize against that which we know to be true in our hearts.
However, THEN, we will receive NO reward for choosing that right path because, without a yetzer hara, we will do so naturally. It is NOW, before Moshiach comes and ushers in that near-perfect existence, that we earn reward for putting spiritual values above materialistic ones. It is now, through our free-will choices, that we earn merit in the ultimate Eretz Yisroel: the World-to-Come
As to the purpose of Torah and Mitzvos when Moshiach comes, see Tanya Igeret Hokodesh Epistle 26:
But when the Shechinah will emerge from kelipat nogah [or: from the kelipot], after the extraction of the sparks will be completed, and the evil of the kelipot will be separated from the good of holiness, “and all the workers of evil will be dispersed,” and the Tree of [Knowledge of] Good and Evil (which is of kelipat nogah and which prevails during the time of exile) will no longer be dominant, because the good will have departed from it,
Kelipat nogah is influential only by virtue of its minimal component of good; as soon as this is extracted, kelipat nogah will have no dominion whatever.
then people will engage in the study of Torah and in the observance of the commandments not in order to extract the sparks, as in the present, but in order to bring about the consummation of yichudim (“unions” or “marriages” of Sefirot) more sublime than those which are effected through our present Torah study — in order to call forth more sublime lights, transcending Atzilut.
This is explained in the writings of R. Isaac Luria, of blessed memory.
Everything [will be accomplished] by means of the pnimiyut of the Torah, the esoteric dimension of the Torah, by the performance of the commandments with lofty mystical devotions directed to [drawing down] sublime “lights” [from the Divine Luminary].
For the root of the commandments is exceedingly high, in the blessed Ein Sof, at a level loftier than Atzilut.
The Lubavitcher Rebbe explains that there are 3 general periods of time.
- Nowadays, before the times of Moshiach.
- After Moshiach comes, the Rambam says that the world will continue to function like nowadays, and Mitzvos will continue like nowadays (just in the ultimate manner).
- During the Ressurection period, "Mitzvos", as "commandments" will be nullified. However, "Halachos" will not, meaning that nowadays we need "mitzvos" to connect ourselves to Hashem (Mitzvah is from the word "Tzavsa", or connection). In this third period of time, our bodies will naturally be nullified to Hashem, and our bodies will physically be unable to violate a commandment.
It says in the Midrash that Hashem created the wold because he wanted a dwelling place in the lower worlds. Meaning, that the lower worlds (physicality) should be nullified to Hashem. So, in reality, this period is for what Hashem created the world.
Maimonides writes (I'm paraphrasing off the top of my head, will give citation later):
The prophets and sages did not prophecy and await the days of the Messiah so they could rule the world; rather, so they could have their time free to delve in the Torah and its wisdom, to better merit the World to Come.