It seems to me as though people who make a big deal out of "lack of diversity" in any field are saying that it's because of some form of discrimination or bias in hiring. This is the primary hypothesis they're putting forward, often as fact, as opposed to the reality that it's a hypothesis until it's adequately substantiated with unbiased data collected from multiple sources.
The hypothesis may be true, but it's hard to tell objectively (e.g. I don't know many managers who would even be capable of seeing that they're biased, let alone acknowledging their biases). Accusing people of being biased without evidence isn't constructive for anyone involved either.
So we need to come at the problem a little differently, and accept the fact that we're never going to get a 100% clear-cut answer, but we can get much closer to the truth than we are right now. We also need to accept the fact that the reality will change over time, and so regular interrogation of the hypothesis is necessary.
We can look at a variety of metrics to try to tease out whether there are biases in specific companies (this list is by no means complete, these are just two studies that I can think of conducting off the top of my head):
1. Compare the candidates who actively apply for jobs to those who actually get the jobs. This comparison must not only include candidates' group affiliations (ethnicity, gender, age, etc.), but reliable measures of competency for the particular role for which they applied.
2. Find out from a larger pool of people outside of (1) whether they would have applied for a particular job but did not or could not because of particular barriers.
If you find that the data from (1) shows that there are candidates who have particular group affiliations and meet the competency criteria for the roles, and they are less preferred by a particular company than people of other group affiliations of similar or lower competency, then you can say with a reasonable degree of likelihood that whoever made the hiring decisions at those specific companies is/are probably biased. Not the company as a whole - just the people who made the hiring decisions (there won't be data on the other people in the company, so you can't make judgements of them from such a study). Do that for enough companies in different geographies and you'll get a sense of the different biases in different cities/states/countries (e.g. some places may be biased against competent women, others may be biased against competent older people).
Then, (2) should help us to find out qualitatively what factors are actively contributing to people not even applying for particular jobs in the first place. These may be structural problems in countries'/states'/cities' education systems, lack of access to food or housing, poverty, etc. (the possibilities are almost endless). This will form the basis for more study to figure out how to best address particular structural problems/impediments.