Whenever your ruler dies without an heir, 3 things can happen, depending on your prestige, royal marriages and diplomacy:
1) If you are a less prestigious country, and have a royal marriage with another country, you might straight up fall under a PU with that country, regardless of the two of you sharing a dynasty or not. If you have a PU yourself, this cannot happen.
2) If you have high prestige, or you already have a PU, and have a royal marriage/multiple royal marriages with countries, the royal house from the biggest of your marriage partners (based on development), will spread to your country. This is what is happening in your game, Russia has the most development out of your marriage partners, so the Russian dynasty will spread to your country. You won't be under a PU, there's an alert you'd get for that if that were the case. Note that a royal marriage is also required, so if you don't want the Russian on your throne, you can break the RM before your ruler dies. However, that would mean in your case, that instead the Spanish dynasty will spread to you, so you'd have to break that marriage too if you don't want that either. If you have no sovereign marriage partner, a local nobel would become the new ruler.
3) If you already share a dynasty with one of your marriage partners, you might fall under a PU if your prestige is low. If they decide to claim your throne, and you die heirless, you'll definitely fall under a PU in that case, and one of your would be overlord's rivals will get an opportunity to contest the PU and take you for themselves.
Before you reloaded, you lost Spain most probably because your royal marriage broke when your ruler died (they break upon the death of the party who offered it), and their relations with you dipped into the negative, which instantly breaks any alliance.
Regarding your mission tree PU CB, the warscore cost will be 60%, and there will be a 'Force Union' peace deal option you can take, which will make then your junior partner regardless of their size. Keep in mind that in order to keep the union, you'll need to have positive relations with them by the time your ruler dies, otherwise they'll break free upon your ruler's death. They'll get a -100 modifier when you force them into an union, but that ticks away relatively quickly, the bigger hurdle would be the negative relations they'll get from the AE cost of forcing the union. But you can improve relations to 200 once they are a subject, can use great power influence on them and give them a gift, and also subsidies, plus you'll get some positive modifiers for being the same dynasty. You went Protestant in this game, I presume they stayed Catholic, so you might get negatives from differing religion and depending on what Council of Trent modifiers were chosen that might get aggravated or eased a little. All in all I think you can keep them, if you time the war with a fairly young ruler (though RNG can always troll you), and making sure they don't have too much additional AE with you before you declare the war, the amount you get from forcing the union will be enough to overcome. But they are pretty far away from your direction of conquest, and you are/were allies for the most of the game, so you shouldn't have too much AE accumulated with them anyways.
Finally, regarding Burgundy, and PU integrations: the Burgundian Inheritance is a special mechanic and doesn't work like normal PUs do. Basically if upon Charles the Bold's death they'll either remain independent (unlikely in the case of the AI), or choose one of 3 possibilities to 'protect' them, i.e become their junior partner: 1) the HRE emperor, if they like him, and hate France; 2) France, if they like him and hate the HRE emperor; 3) someone they have a royal marriage with, provided Burgundy hates both France and the HRE emperor. After they become a PU, there's an event that will fire, representing the real life death of Marie of Burgundy, Charles' heir, and the country that got the inheritance will instantly integrate Burgundy. Normal PUs don't work that way, in order to properly integrate them into your country, first at least 50 years have to pass after they've become a junior partner. After 50 years passed with the union being continuous (they never declared an independence war or became free upon a ruler death with negative relations), you can either inherit them when your ruler dies (only true for small(ish) PUs, because the chance of inheriting them depends on your diplomatic reputation, which raises your chance, and their size, with every province they have lowering the chance by a flat -1%), or integrate them like you integrate a vassal. Given Spain's enormous geographic size, you'll never be able to inherit them, and you'd have to diplo annex them if you want their lands to be directly under your control.