Maybe someone can correct me but I'm skeptical of the claim that France wanted a Franco-Spanish union. Phillip was 5th or so in line for the French throne when the War of the Spanish Succession began and I don't think anybody could've predicted that 3 generations of French heirs to the throne would die suddenly. Louis probably wanted the union but I don't see how it could've been achieved at the time or that it was France's goal from the start.
With rival houses of Bourbon and Habsburg each ready to resist to the utmost the other's claim, partition of the Spanish empire appeared the only solution if a general war were to be averted. In September 1698 William III and Louis XIV met secretly to frame what became known as the First Partition Treaty. There were three major claimants to be
considered:
Bourbon candidate - Philip Duke of Anjou, grandson of Louis XIV
Leopold's son (by his second wife) - the Archduke Charles
The Elector of Bavaria Joseph Ferdinand - grandson of Leopold I and his former Spanish wife Margaret Theresa of Spain.
The choice of the two royal planners fell on the young Bavarian prince, who being the least powerful of the three candidates was the least likely by his acquisitions to disturb
the balance of Europe. Consolation prizes would be provided by pruning the Spanish inheritance of it's Italian possessions—the Kingdom of the Two Sicilies (Sicily and Naples) going to the French Dauphin Louis, and Milan to the Archduke Charles.
This settlement was signed by England, France and Dutch Republic. However, young Joseph Ferdinand died on February 3rd of 1699. Spanish succession was uncertain again. Louis and William tackled the knotty problem of succession in June of 1699 and agreed on a Second Partition Treaty. In March of 1700 Treaty was signed in London. They selected as the chief heir the Archduke Charles, who was to be King of Spain and the Indies and ruler of the Spanish Netherlands, on condition that these territories should never be joined to the Empire. Naples, Sicily and Milan would go to the French Dauphin. The division seemed reasonable, but Leopold wanted all for his son and refused to accept such terms.
Charles II died on 1 November 1700 and Louis received the offer on 9th, giving him the option to accept or insist on the Treaty of London. The latter would in theory give the throne to Archduke Charles but if Leopold continued to refuse the territorial concessions, Louis could demand Britain and the Dutch join him in enforcing the Treaty, leaving Austria isolated. However, French diplomats advised the anti-French mood of the Habsburg court meant war either way, while Britain and the Dutch would neither fight for nor against Austria. On balance, this made it preferable to accept the will of Charles.