You really have to wonder why somebody at the Spanish court didn't take their king aside and have a quiet word with them. Even if only for the sake of the court genealogists who must have been confused as hell drawing up the family trees.
Even in the C16th, someone must have been able to figure out that a Habsburg level of inbreeding couldn't be a good thing.
"Yes sire, I know your niece is sexy, but look at this beautiful Prussian/Polish/Scandinavian girl - she's pretty nice as well, no? Maybe?"
SOP for Habsburg power politics in that era. Your courtier thinking outside the box would be using his innovative thoughts to convince the sovereign to marry this relative instead.