It is not really even clear when the Pantheon was first built. Many historians believe that it was first built by the Emperor Agrippa in 27 BC. If that structure was actually built, however, it burned down almost completely. The structure that now stands was built by the Emperor Hadrian, beginning in 120 AD. The reasons for building would have generally been the same, regardless of which emperor we are talking about. The general reason was to honor all the gods of Rome.
Rome’s religion was very much polytheistic. There were many gods and goddesses, each of whom had their own roles to play and each of whom were worshipped in different places. The Pantheon was meant as a temple to all of the gods and goddesses. This sort of thing was very important in Rome. The Romans believed that the gods did not care about what the Romans thought or believed. However, they did care about how the Romans behaved. Specifically, the gods cared about whether the Romans did the proper things to show respect for them. Building the Pantheon would have been one of the things that could be done to show respect.
It is also likely that the building was done in part to satisfy the emperors’ egos. The emperors of Rome liked to have their names on large and impressive buildings as those buildings would be monuments to them after they were dead.
For these reasons, the Pantheon was created.