Just before the Spanish transition to democracy, the Carnation Revolution in Portugal occured. This revolution was a coup organised by some officers in the Portuguese Army, who had grown disaffected with the ruling corporatist regime, particularly over its long-drawn-out colonial wars. This revolution was a broad coalition of liberals, socialists and communists. The hard-line communist faction launched a successful counter-coup to acquire power, much to the dismay of the United States. However, this was quickly followed up by a liberal-led counter-coup, which was successful and the next year Portugal had free and open elections.
During the height of the political instability in Portugal, Spain approached the naturally worried United States and offered to invade Portugal if it became a communist state, which the United States acceded to. With the impending death of Franco, the United States' primary interests were protecting its military bases and assets in the country and preventing from becoming subjected to a communist regime. The then National Security Advisor and Secretary of State, Henry Kissinger, a practitioner of Realpolitik, sought an orderly regime change.
It is important to note when Franco took power in 1939, he established Spain as a monarchy, albeit with an empty throne. He did not immediately coronate a King, as having even a symbolic and constitutional figure as Head of State could still undermine and erode his own power and loyalty of others. Nevertheless, Franco's ultimate goal was to re-establish monarchy in Spain, ruling under the values the francoist values he espoused.
Franco initially wanted to restore the Spanish monarchy by reinstating a Habsburg monarchy, but as the Habsburgs hadn't ruled spain for hundreds of years and were very distant and foreign to Spain, they denied the request. This meant, Franco had to fall back on his other option of reinstating the recently deposed House of Bourbon-Anjou. With Juan Carlos being chosen as the designated successor, Kissinger decided to back to him, seeing him as a guarantor of stability and anti-communism. King Juan Carlos favoured a calculated and careful transition to Spanish democracy, which he carried out this out by eventually appointing a Prime Minister, Aldofo Suarez, who went about disassembling the Francoist government, legally through its own governmental system, to avoid any action being taken by the Spanish military.
So in conclusion, the United States had main interests of stopping a communist government from being propped up and securing its military bases in Spain. Whatever new system of government would facilitate this was irrelevant largely to the United States (whether it be a Francoist state or democratic one). But the United States saw that King Juan Carlos was the most logical figure to back and so he was supported by them.