I previously worked for a company that spent $5-10k psychometrically testing each potential hire in 1 on 1 sessions with a psychologist after they had passed an initial interview. The tests were a mix of general IQ (to ensure people actually had suitable mathematic and literary skills needed the role) but also quite a bit of personality testing. The company founders recognised the huge detrimental impact certain personality types could inflict on an organisation. So they spent considerable money and effort to try to detect and reject candidates that were likely to be passive aggressive, too dominating, inflexible etc. They actively favoured candidates that were able to demonstrate aptitude and personality traits aligned with being a team player, even if the candidate was less experienced for role (ie find quality people first, train them if necessary).

This was the best place I have ever worked. Problems (and successes) were shared. Internal conflict was very rare. If one person was overloaded, the team would work out who might be light on work at the moment and could assist. Work hours were very flexible - outputs not inputs were what mattered. We had a lot of autonomy and were encouraged to be creative and take some risks in developing new tools and services.

The employees were from a diverse range of ethnic and religious backgrounds. The male/female ratio was probably around 60/40 for a company of mostly engineers. Age of employee was mixed but favoured younger engineers. The company was a consultancy so it was a place people would work at to gain diverse experience then move on to specialist positions elsewhere. It was rare for older engineers to be looking to gain diversity of experience.

Given the personality types - this meant we had lots of really interesting discussions about different countries and cultures and life experiences. So "culture fit" at this company did not mean "the same as me" other that with respect to: will work hard, is intelligent enough, will be a team player.

Sadly, after a few years of awesome work life, some of the owners wanted to cash out and the company was acquired by a multi-national. The culture of the original company was quickly destroyed. No autonomy, ridiculous levels of authorisation (4-5 just to purchase $500 of IT equipment for example), competition from internal groups stealing clients, very few team players, inputs favoured over outputs (lots of "make work" going on). The transition experience really rammed home how real the Peter Principle is and the drawbacks of tall hierarchical management structures.

"Culture fit" to me means rejecting people that won't work within the organisational structure you are trying to build. Note that it doesn't mean non-team players should always be rejected. If you have a team of individuals that largely work in isolation and prefer to reduce communication to a minimum, hiring a team-oriented person could be detrimental.

As for "culture fit" being used as a cover for discrimination, I'm sure it happens. If someone is discriminating then they will want to cover their arse somehow and "culture fit" is vague enough that it can easily be used for that purpose.

Perhaps "personality fit" would be a better term for what I describe above? Though I have never heard it being used and I suspect a lot of-people in tech like to think that merit matters more and could find "personality fit" to be offensive.