A lot of "nerds" have personal insecurities and downtime. The potent mix of the two leads to more gatekeeping behavior than is necessary.
It's for this reason that many people (especially women, PoC, etc.) will be hostilely quizzed when they express an interest in something nerdy. It's not overt racism/sexism, so much as a "oh no, if they share my interests, I'm less special" sort of reaction.
Unfortunately, nerdiness doesn't strongly correlate with emotional maturity.
But things don't have to be this way. We all have the choice of what kind of person we want to be. Some people just choose very poorly-- short-sighted selfishness that hurts them long-term and everyone else at all times.
There are a lot of "nerdy" individuals who choose better. I'm happy to know of at least 100 in my industry.