This is a much bigger problem than just the software industry in the US. I'm a Navy veteran, as a nuclear reactor plant mechanic. I remember being shocked in MEPS (the enlistment and entry processing center for all branches of the armed forces) by the number of black men enlisting in the Army and Marine infantry - it's much higher than the local population would suggest. But of the roughly thousand or so people I worked with as Nukes in the Navy, I can recall only one black man. The trend is just as strong in college. While I'm working as a software engineer today, my degree isn't in CS: its in Mechanical Engineering. The same trend applies there, too. I've worked with a grand total of one black engineer professionally, and he was an intern! There is a serious problem in this country with our failure to attract black and latino talent to engineering. Its pretty frustrating to see all the media attention focused on bringing women into CS, while almost zero attention is being focused on the lack of black and latino engineers.
I can't point to any single factor that is driving this trend. But it must happen in High School or earlier, since it's already totally broken by the time folks are graduating HS.