You’re asking about the Brownsville Affair of 1906. The short answer is that the 167 Black soldiers were accused of a shooting raid in Brownsville, Texas, but strong evidence suggests they were framed; the punishment was a mass, dishonorable discharge ordered by President Theodore Roosevelt, which cost them their Army careers and pensions.britannica+1
The soldiers belonged to the segregated 25th Infantry, and many white residents in Brownsville already resented their presence. After shots were fired one night, killing one white bartender and wounding a police officer, local officials blamed the Black troops even though their commanders said they were in barracks at the time and evidence later appeared to have been planted.wikipedia+2
Roosevelt ordered all 167 soldiers discharged “without honor,” based on what the Army called a “conspiracy of silence.” That meant they were punished as a unit, without individual trials, and lost military standing and the benefits that came with service.tshaonline+2
The result was one of the most notorious cases of racial injustice in U.S. military history. The action caused major outrage, and years later the Army cleared the records of the men who had been punished.nytimes+1
If you want, I can also give you a 5-sentence plain-English version of the whole Brownsville Affair.