The Church of Jesus Christ of Latter-day Saints do not have a definitive answer to this at question, but the primary theory is it wouldn't have survived earlier (see below for further explanation). Similar questions could be asked about why did Jesus wait until he did to come (ie why didn't he come sooner/later)?
The primary theory on why it took ~2000 years to restore the gospel is the gospel wouldn't have survived earlier because of limited religious freedom (see below on importance of reformers, many reformers in Europe in the 15-1600s were imprisoned and killed for trying to change up the existing church, let alone establish a new one, earlier the apostles/disciples were martyred which led to the apostasy-According to the LDS, when did the 'true church' cease to exist). So the restoration couldn't happen right away as Jesus's followers were killed. And later other churches didn't allow other denominations.
Prophets lead what are called dispensations, which are when (1) God has at least one authorized priesthood leader on the earth and (2) this leader, a prophet, learns about the plan of salvation directly from God. The prophet then teaches, or dispenses, the gospel to the people.
Some important ones were those of Adam, Enoch, Noah, Abraham, Moses, Jesus Christ, and Joseph Smith. The Lord began a dispensation through each of these prophets.1 This current dispensation is prophesied to be the last until the Second Coming (D&C 27:13)2 I bring up dispensations in that the plan wasn't to have a restoration happen temporarily and be lost again, but to have one final dispensation.
A few points to consider:
God's ways/reasons are not man's ways
Isaiah 55:8-9
8 For my thoughts are not your thoughts, neither are your ways my ways,
saith the Lord.
9 For as the heavens are higher than the earth, so are my ways higher than your ways, and my thoughts than your thoughts.
the entire world (past/present/future) benefits from Jesus Christ's Atonement, the when of the Atonement isn't the important part, the Atonement is the important part
our ability to be tested in mortality does not require the church, though it is a great benefit. (The ordinances required for exaltation can happen later by proxy-for those who didn't have the opportunity)
though the LDS believe in an apostasy, that does not mean other denominations do not have some truth or do good (we have the bible, which led Joseph Smith to read/pray and restore the church); other denominations have brought, and continue to bring the basic message of Jesus Christ to millions of people. The Holy Ghost can be felt by all (According to LDS, do all non-LDS Christians lack the Gift of the Holy Ghost, and if so, how does this lack manifest itself in the lives of non-LDS? and How do Latter-day Saints explain testimonies of profound experiences with the Holy Spirit in other denominations?)
During the Great Apostasy, some religious-minded people in Europe realized that the gospel of Jesus Christ was not being taught correctly. These reformers were not prophets, but they did their best to teach the truth as they understood it. They helped make the Bible available to more people. Many fought for religious freedom and opened the way for the Restoration of the gospel.1
The gospel restoration started with Joseph Smith but is ongoing today3
See also:
1 What, Why, and How: A Breakdown of the Restoration, New Era 2018
2 The Last Dispensation, Elder Alvin R. Dyer Apr 1972 General Conference
3 The Ongoing Restoration, Elder LeGrand R. Curtis Jr. 2020 and Article of Faith 9