The original reason for two days of Yom Tov in the diaspora was uncertainty: when the Sanhedrin established the calendar by lunar sighting, distant communities that the Tishrei messengers could not reach in time did not know which day had been declared Rosh Chodesh, so they observed two days as a precaution — as the Rambam (Mishneh Torah, Sanctification of the New Month 5:1–7) states explicitly.
Even after the Sanhedrin ceased and a fixed calculated calendar made that doubt technically obsolete, the Sages decreed that the practice should continue — the Sefer HaChinukh (301:2) explains that Chazal enacted that those distant from the Land should still observe two days "as they had done in the earlier era," and the Rambam (Mishneh Torah, Sanctification of the New Month 5:8) adds that since two days had already been observed even during the period of lunar sighting, the Sages instituted that even the people of Eretz Yisrael should permanently observe two days in this era of fixed calculation.
The Mishnah Berurah (496) grounds the perpetuation of the practice in a further concern: the Sages feared that amid the hardships and upheavals of exile, the calendar calculations might be forgotten, leading people to miscalculate months and ultimately eat chametz on Pesach — so they left the diaspora custom in place as it had been in earlier times (Mishnah Berurah 496).
The seriousness with which the rabbis treated the second day is reflected in the Shulchan Arukh (Orach Chayim 496:1), which rules that everything forbidden on the first day of Yom Tov is equally forbidden on the second, and that one who treats it lightly is subject to excommunication.