Gets deep into this part of history, and goes deep into what was shared between companies and research as well.
The answer is... both. Yes, DARPA wanted a self-repairing communications network but the computer hackers at MIT, Harvard, Utah, and the Bay Area would have likely produced something very similar without government being involved. One interesting legacy from the DARPA funding is the RFC nomenclature: the students designing TCP/IP couldn't "specify" anything without risking their funding, so a public "Request For Comment" was a way to publish how they were implementing things -- and how others would need to do it also if they wanted to be compatible.
Let me quote the title of the link above: "Number of people SHOT TO DEATH BY THE POLICE in the United States in 2017-2018, as of June, by race".
Exposure to "toxic substances"? I don't think so.
Also, tech industry != "the internet".
If you're really interested in having a debate, go ahead and read Emily's book. Seriously.
While you're at it, "The Innovators"  is also a good read, and it'll be helpful to understand that the roots of our "tech industry" really started 100+ years ago, with a disproportional growth starting several decades before Larry and Sergey even got admitted to kindergarten...
The gender disparity we're seeing today is the consequence of several decades of systemic and widespread conscious and unconscious biases, that have shaped the perception of an entire generation.
Once you refine your understanding and start paying attention, you can see it everywhere. And unfortunately it'll take decades to fix.