...nor shall any flesh...remain overnight... (Deuteronomy 16:4)
The korban Pesach (Passover offering) wasn’t the only sacrifice brought for the occasion; there was also the korban chagigah (Festival offering), brought on the holiday itself. While the meat of the korban Pesach had to be finished that night, the korban chagigah had a longer “shelf life.” How long? In this mitzvah, we are informed that one may not leave over from the korban chagigah until the third day. Therefore, the chagigah could be eaten on the 14th and 15th of Nisan, after which time it must be burned.
The reason for this mitzvah is that Passover is an extremely joyous occasion. This sacrifice, in addition to the korban Pesach, magnifies our celebration of the Exodus from Egypt. But to leave the meat around too long makes it not so nice and kind of degrading, at which point it is no longer appropriate for us to use it. To eat sacrificial meat beyond its designated time would violate the prohibition of nosar, as detailed in Mitzvah #143.
This mitzvah only applies in Temple times. It is discussed in the Talmud in tractate Pesachim on pages 71a-b. It is codified in the Mishneh Torah in the tenth chapter of Hilchos Korban Pesach. This mitzvah is #118 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.