The simple (and much more important) fact is that the current French Republic is the successor of the kingdom of France (and of the various regimes that existed in-between). In spite of all the turmoil and deep changes that happened in the last two centuries, the state still sees itself that way, honors international commitments and agreements, etc.
Even if many were discontinued or destroyed, earlier institutions or traditions were not by any means “erased” either by the French revolution, the creation of the third Republic (the first one to be stable and to break durably with monarchic governance – and catholic meddling) or the enactment of the current constitution. Conversely, titles or prerogatives that can be traced back to the king of France need not have been “inherited” all at the same time.
The distinction was not as clear then as it might be today but beyond the person of the king, the Andorran co-princeship and various other oddities can also be regarded as an agreement between two states, even if it was not formalized in writing. And just like any other aspects of international law, its effectivity primarily depends on both parties agreeing on its validity.
Concretely, it was suspended during the revolution (apparently at the behest of France, which refused the payment) but Napoléon restored it and put the prefect of Ariège in charge. Andorra simply continued to pay the tribute and to recognize the title through all the regime changes after that. France even intervened directly in Andorran affairs at several points during the 19th and 20th centuries.
While Andorra is mostly a curiosity, the relationship with the catholic church is quite interesting. It was at times very tense (in particular after 1790 and 1905) but it normalized relatively quickly in both cases and France then regained most of the prerogatives, obligations and privileges that existed before the revolution. The French state thus still administers several churches in Rome (through the Pieux Établissements de la France à Rome et Lorette).
Most presidents did not claim the honorary title of canon priest of St. John Lateran but the tradition was revived by president René Coty in the 1950s. At the time, relations with the church and the Holy See were pretty good so they would have no reason to make difficulties in recognizing it. Nowadays, I think the Holy See officially invites the president to a ceremony and that's really all it takes to inherit something like that. But I am not sure exactly how they handled it during crisis times. I suspect nobody asked and it was just ignored.