Hitler had no capability with which to take Gibraltar. Especially not as long as the Royal Navy existed, a RN which the Germans had little ability to interfere with.
The RN would have simply blasted any attacking Germans right off the rock.
It would be similar to trying to take Iwo Jima as a massive Jap fleet surrounded the island.
The Germans didn’t take Gibraltar, because they couldn’t. Tobruk was weaker than Gibraltar and Rommel and the Africa Corps couldnt take it despite a 7 month siege. But the blockheads were just gonna storm Gibraltar.
The Brits were too strong.
Even if true, without question, Hitler still invades Spain, and with it, would have gone one of the few safe havens Jews had in Europe.