There will not be a personal union, the Wittelsbach line would split.
I know, but the thing is the continent is against any personal between Spain and another power. Bavaria though not a leading power was power at the time. Hence Bavaria would pass to the younger brother of Joseph whilst he would become King of Spain.
Spain's domain's were already divided by treaty, so that upon the ascendance of Joseph the lands of the Hapsburg would be split up. Archduke Charles was to get Milan; the Dauphin was to get Gipuzkoa, Naples, Sicily, Finale and Presidi; Joseph was to get Spain, Sardinia, Southern Netherlands, and Overseas.
The reason the Austrian gains are "meagre" is because they hold a weaker claim.
No they weren't already divided, France and England had reached an agreement without consulting Spain, Austria, Savoy, Bavaria and other third parties.
An Austrian army in control of Bavaria would certainly be able to get a better deal, though admittedly they would rather have more territories in Italy, but any compensation would be at the expense of Bavaria. Overseas isn't a real option, so this leaves Sardinia and the Southern Netherlands, given the fact, that Austria lacked any real naval power in that part of the Mediterranean, so this only leaves the Southern Netherlands to placate Austria.
As for the weaker claim, Joseph and Charles had a stronger claim than Joseph Ferdinand, only the Dauphin had a better claim.
The key from all the issue of the succession of the Spanish Kingdom was the last will of Phillip IV. There, he clearly excluded his eldest daughter Maria Theresia, Queen of France and her descendants, and bypassed them with the descendants of his younger daughter Margaret, the full-sister of Charles II, mostly because since childhood she was betrothed to Holy Roman Emperor Leopold I, her maternal uncle and member of the Austrian branch of the Habsburgs, so is logical to think that the King preferred to favored his Austrian cousins than the Bourbons.
Thus, following the line of succession estipulated by Phillip IV, the only possible heir of Charles II was Joseph Ferdinand of Bavaria, the only surviving descendant of Margaret by 1696. If he will survive, indeed inherited the Spanish Kingdom COMPLETE, at least in theory, because Charles II in his own will refused any partition of his domains and given all to his grand-nephew.
Now, will be interesting to see what could be the reaction of Louis XIV if Joseph Ferdinand became King: because one of the clauses of his marriage contract estipulated that Maria Theresia recovered her rights if her dowry wasn't fully pay (and this exactly happen), so by right of primogeniture, the Grand Dauphin, as the only surviving son of the French Queen, was the legal heir of Charles II, because in the Kingdoms of Castile and Leon the female inheritance was allowed (in the case of Aragon, this could be debatable). In default of the Dauphin (heir of France), his sons had the primarly right to inherited, in this case the second son, Phillip, Duke of Anjou. So, Louis XIV could probably began a war for the rights of his grandson.
Good point. Legally, le Grand Dauphin was the heir presumptive to the Spanish monarchy, considering Mara Theresa's dowry was never payed (kind of a ridiculous clause to put in considering Felipe IV knew how bad his finances were). However, as the first partition treaty showed, Louis XIV wasn't adverse to a deal that would give him some of the Spanish empire. The real question becomes whether or not he, and Austria to be honest, would accept the Electoral Prince as the successor to the entire Monarchy.
We could end up seeing a truly bizarre sight: an alliance between France and Austria to divide the Spanish empire (France gaining the Netherlands and Austria the Italian possessions?) against an alliance of Spain, England and the Netherlands. Its out there, to be sure, but history itself has seen stranger bedfellows.
A Franco-Austrian alliance would certainly be a possibility. IMHO a French Southern Netherlands isn't going to happen. Austria getting Sicily, Naples, Presidi and Finale in addition to Milan seems equally unlikely. IMHO altering the Franco-British agreement seems more likely. France does indeed have a more recent closer connection and thus a better claim, but what they offered Austria seems a bit insulting, especially if they have to accept the ascendency of a rival Catholic dynasty in the Empire. So, again, the wealthy Southern Netherlands, may not be Austria's first choice, but it could help to sugar coat the final result and make it easier to sell the outcome.
Don't forget that Austria by regaining much of Hungary from the Ottomans was in the ascendency. Another reason, why IMHO Austria might be able to expand their compensation at the expense of Bavaria.
Then there also is Savoy, unless France and Austria want give a bit from their share (bits of Milan and Finale), there's only Sardinia left.