A friend of mine recently drew my attention to this article about the gender of the word Brexit in various European languages. It notes that the word is masculine in French and German, but feminine in Italian. The Independent's version of the story points out that it's also masculine in Polish, Flemish, Catalan and Welsh.
Italian has a justification for making it feminine, in that the word it's based on, exit, is feminine when translated into Italian (uscita). This is a terrible justification, in my view, as it isn't the word uscita - it's the borrowed word exit, and there's no reason on earth why they should have the same gender. As someone in the comments noted, you can have two words for the same thing with different genders, and gives the example of das Auto (neuter) and der Wagen (masculine), both meaning 'car' in German. It's word that have genders, and exit is a different word from uscita. However, it's the Accademia della Crusca, Italy's language body, that has decreed this and they have fixed principles on the matter, so they must stick to them.
If a new word is similar to an existing one, then it'll tend to behave like that one. An invented verb like gling might have an irregular past tense glang, on analogy with sing. We might be tempted to pluralise POTUS (President of the United States) to POTI on analogy with other words ending in -us, like cactus.
If there isn't an easy parallel to draw, then I'd expect it to be masculine, as it is in the other languages mentioned. In Spanish and Italian, for instance, nouns end in -o or -a. This doesn't, so we have to just pick a gender. As the article says, most new words get masculine gender. This isn't, however, because 'Spain, being a Latin country, opts for male', as the Guardian lazily jokes. It's because whenever you have sets of things in grammar, there is a marked and an unmarked option. Consider number: we add something (usually -s in English) to show that a noun is plural, and without that, we assume it's singular. Singular is 'unmarked', plural is 'marked'. Consider positive and negative sentences: we have a word to show that the sentence is negative, but nothing to show that it's positive. Negative is 'unmarked', positive is 'unmarked'. The unmarked option is the default option.
When it comes to gender, masculine tends to be the unmarked option. If you have a group of friends in Spanish, then if they're all male, they're amigos. If they're all female, they're amigas. If they're mixed, then they're amigos (masculine). Now, whether this reflects a deeply sexist mindset, whether it has contributed over many generations to sexist thinking, or whether it's totally unrelated, probably remains an unsolved question. But it does mean that new words get masculine gender in most languages.
Welsh appears to be taking a very pragmatic approach to the matter: it's masculine because if it was feminine, it would have to have 'consonant mutation', which is when certain nouns change the sound they begin with under certain conditions. It's just easier to make it masculine.