There are two ways that words can be related cross-linguistically. They might both descend from the same word in the common ancestor language, so for instance "rain" in English is by origin the same word as "Regen" in German. Or one language may have borrowed the word from the other language after they had split, perhaps quite recently. In the first case, usually the genders will remain the same though there are exceptional cases (and comparing English with German doesn't show this, because English is not a gender language any more; but I would think that in Old English, which was, the word for "rain" was the same gender as in German, though I haven't checked this as I write). On the other hand, if a word has been borrowed from one language into another in recent times, then the borrowing language won't usually care about the gender system of the lending language, it will just assign a gender to the borrowed noun by reference to factors in the borrowing language. Your examples are all of the second type, so there is no reason to expect the genders to be unchanged. That is all the more true because most of these are not cases where a word has been borrowed from Spanish into German or vice versa, but where both those languages have separately borrowed the same word from English, which (as we know) isn't a gender language anyway: you could hardly expect the Germans to say "The English have a word beefsteak which would be handy to use, but hang on, we've noticed that the Spanish have borrowed it and made it masculine so it had better be der for us"! The first Germans to talk about "Beefsteaks" probably didn't know a word of Spanish.
Some of the factors which have been found to affect the way words are gendered in their new languages are the meaning of the words, their phonological shape, their possible/actual translation into the host language, or the users’ feeling that one gender is more ‘neutral’ or more ‘marked’ than another.
These two studies have more on this, both dealing with French:
‘Gender assignment to nouns codeswitched into French’
‘Gender Assignment and Word-final Pronunciation in French’