Because part of the reason (and, IMHO,
most of the reason) that Juana was imprisoned in the first place is because Fernando (and Philip, before his death) wanted to rule in Castile in her stead post-Isabella's death. Juana almost certainly wasn't as mad or unable to rule as she's popularly depicted, and a lot of the claims about her mental health/madness are now disputed by historians; while she probably was mentally ill, it's likely that she just suffered from depression, and that doesn't make her unable to rule. Above everything else, Fernando and Philip were looking out for their own interests, which is proven by the fact that at different points, both of them acknowledged Juana's fitness to rule, thinking that it was the most strategic thing to do (Fernando did it when the nobility in Castile rejected him in favor of Juana, and Philip did it when Fernando tried to assert his right to rule in Castile, which would have had Fernando in control instead of him). Fernando was particularly nasty about keeping control of Castile–before Juana was even imprisoned,
he minted coins that made it seem like he and Juana were joint-rulers in Castile, rather than Juana ruling by herself and in her own right, and IIRC, he and Philip feuded repeatedly over who would rule in Castile. Before the prospect of Juana being imprisoned even happened, they were going behind her back trying to deprive her of the throne. Fernando took advantage of the unrest that happened in Castile after Philip's death (including an outbreak of illness in Castile that coincidentally faded when he arrived back in the country, something that was superstitiously taken as a sign of favor in the 16th century) to force Juana to hand over control of Castile and Leon to him. And even after
that happened, Juana made it clear that Fernando was taking power from her against her will.
And in addition to
that, IIRC, Isabella made Fernando swear that he wouldn't try and deprive Juana of her throne when she was on her deathbed, along with his promise to never remarry (a promise that he also ended up breaking). I could be wrong about that, but there definitely was a part of Isabella's will that specified that Fernando would only take power in Castile if Juana was unable to rule, and that he would only be able to rule until Charles V came of age (though this was more due to her dislike of Philip of Burgundy than any concerns of Juana's mental health). Fernando definitely wouldn't have been able to convince Isabella that Juana was mad and needed to be imprisoned because if Isabella were alive, Fernando wouldn't have tried anything. And Philip of Burgundy, who is thought by some historians to have been the one who began spreading the rumors that Juana was mad in the first place (
either him or Fernando), wouldn't have been able to convince Isabella that Juana was mad, either.
TL;DR: if Isabella outlives Fernando, then the chain of events that led to Juana being deprived of her throne and imprisoned in the first place will never happen. Juana ends up reigning in her own right.