Diversity is the solution to groupthink. From the book Surrounded By Idiots, the author demonstrates that people with different backgrounds and behaviour models come together to make stronger teams.
As engineers become more senior, they have a hand in design, in product etc. they bring something of themselves to their software solutions. Making software with only a team of white dudes means you miss the mark on issues important outside that group.
Also, inclusion goes hand in hand with diversity. People from all ethnicities and not just cis males can code, but if your team is mainly white guys, you have to work twice as hard convincing others that they'll be welcome and fit right in otherwise it becomes a self perpetuating pattern.
Also, "abilities" is subjective. If your exemplar for software engineer progression is a path that fits a majority white man route into the industry, and plays to the strengths of the people you promote, you'll over-index on those abilities. It's a good question to ask, what skills are we missing out on because our lack of diversity leads us to self selecting?
For transparency, I'm a white cis male manager, who manages a team of almost exclusively white cis males. I'm working on some long term strategic projects to help foster diversity in engineering in my city.