According to the Hebrew Bible, Solomon’s Temple was built atop what is known as the Temple Mount in the 10th century BCE and destroyed by the Babylonians in 586 BCE, and the Second Temple completed and dedicated in 516 BCE. Around 19 BCE Herod the Great began a massive expansion project on the Temple Mount. In addition to fully rebuilding and enlarging the Temple, he artificially expanded the platform on which it stood, doubling it in size. Today’s Western Wall formed part of the retaining perimeter wall of this platform. In 2011, Israeli archaeologists announced the surprising discovery of Roman coins minted well after Herod’s death, found under the foundation stones of the wall. The excavators came upon the coins inside a ritual bath that predates Herod’s building project, which was filled in to create an even base for the wall and was located under its southern section. This seems to indicate that Herod did not finish building the entire wall by the time of his death in 4 C.E. The find confirms the description by historian Josephus Flavius, which states that construction was finished only during the reign of King Agrippa II, Herod’s great-grandson.
This was because an Imperial decree from Hadrian in 135 C.E. barred Jews from living in Jerusalem. Just once per year they were permitted to return and bitterly grieve about the fate of their people. Comparable accounts survive, including those by the Church Father, Gregory of Nazianzus and by Jerome in his commentary to Zephaniah written in 392 CE. In the 4th century, Christian sources reveal that the Jews encountered great difficulty in buying the right to pray near the Western Wall, at least on the 9th of Av. In 425 CE, the Jews of the Galilee wrote to Byzantine empress Aelia Eudocia seeking permission to pray by the ruins of the Temple. Permission was granted and they were officially permitted to resettle in Jerusalem.
Source: Wikpedia: Western Wall – Roman Empire and the Rise of Christianity