From Rambam's Iggeret Techiat Hameitim:
Now for the answer to the second problem, which is why is the Resurrection not mentioned in the Torah? This is my reply. You must realize that, as is well known, we do not believe that the Torah comes from Moses. No, it is in its entirety the word of the Lord. The problem then becomes a quest of God's wisdom in alerting us to life in the world-to-come and saying nothing to us clearly of the Resurrection. The reason is that, as I explained, this resurrection is of the type of the miraculous, and the belief in what is of this nature comes only from the assertion by a prophet. In those days all the people were Sabeans, who affirmed the eternity of the universe. They used to believe, as I taught in the Guide, that the spirit in the spheres is God, and they called the claim a lie that the revelation comes from God to the human species. Following their assumption they have to repudiate miracles and attribute them to magic and chicanery. You know, do you not, that they tried to counter the miracles of Moses with their magic: each cast down his rod [Exod. 7:12]. You know, do you not, that they marveled: We have seen this day that man may live though God has spoken to him [Deut. 5:21]. This indicates that they had regarded prophecy to be of the class of the impossible. How can a person who does not believe in prophecy be told a story of which there is no other proof save the faith in the prophet? It is decidedly impossible for those who followed their affirmation of the eternity of the world. Were it not for miracles, we would not regard the Resurrection to be in the class of the possible.
(Halkin translation)
It is known that these masses, in whose time God willed to reveal the Torah, were firm in their wrong ideas. Even forty years later, after they had beheld God's wonders, He said of them: The Lord has not given you a mind to understand or eyes to see or ears to hear [Deut. 29:3]. He knew that when they were informed of the innovation of the return of the dead, they would consider it impossible and would emphatically shun it. They would indulge in sin, since retribution was greatly delayed. For this reason they were warned and threatened with punishment, of which they were quickly persuaded: if you listen,... if you do not listen.... Their acceptance of that was more immediate and more beneficial.
(Halkin translation)