In restoring Juan Carlos I to the monarchy instead of his father Juan de Borbon, Franco must have had some reason to believe that Juan Carlos would continue his legacy. Why did that not end up being the case?
Franco led an uninterrupted run of nasty (technical historian's term) until his death (November, 1975). After his death, there was a long, bloody struggle between remnants of fascism, the military, and pro-democracy advocates, marked by rioting, assassinations of liberal leaders, Basque-separatist bomb attacks, and general hell, with the centrifugal forces of demands for regional autonomy threatening to tear apart the post-Franco state altogether. Nevertheless, this unruly era produces, first, a referendum on the adopion of political reforms (especially the legalization of parties) in 1976, free elections in 1977, and the adoption of a fairly liberal constitution by that newly elected parliament, in 1978. This author characterizes this chronology, from the state's point of view, as "using authoritarian power to enact democratic reforms," and I think that's about right.
Here is a longer look-back at the Franco era and the transition to democracy; she lays considerable stress on the "pact of silence," the agreed-on proclamation of an amnesty for crimes committed by the Franquistas during the regime, in exchange for which the still-powerful Right would allow the new framework to be adopted.
With that as background I suggest that Juan Carlos didn't have a lot of choices. If either the left or the right had been thwarted in this process (by an attempt to cling to authoritarian rule by the Right, or by pursuit of a post-Franco vendetta from the Left) the chances were very good that the Civil War could resume, and that Spain would fracture along regional lines in the process. Adoption of an amnesty and a transition to parliamentary democracy were the only options that didn't risk further chaos.
As to why Franco went with Juan Carlos in the first place, I don't know, but I also don't think Franco intended to be dead in the early years of his rule. He may have thought that Juan Carlos was younger and more malleable, more receptive to the guiding hand of Franco as his mentor. Fortunately for Spain, he was not immortal.
Hi there
I answered a question a few months ago that was very similar. I go into detail about Franco's concerns about Juan Carlos and why he chose him to be his successor. Hope this helps!