Statistically red shirts are less likely to die than blue or yellow shirts, as there are significantly more red shirts on board a ship which means a lower percentage of red shirts die, so this joke is illogical.
On top of that, the whole "stormtroopers can't aim" bit is based on a room temperature IQ interpretation of the rebels' escape from the Death Star. People don't seem to remember that scene where Leia points out that they let them escape so that could track them.
What about straight number of said shirt color deaths, regardless of their "endlessly replenishable" supply?
Per the wiki: Of the 55 crew members killed in the series, 24 were wearing red shirts, compared to 15 who had unconfirmed shirt colors, 9 in gold shirts, and 7 in blue shirts.[5] Most casualties were security personnel, whose uniform was red.
That last bit is important here. Ops, Security, and Engineering all wore red shirts. If you break down redshirt deaths by division, almost all of them are Security, while few are Engineering or Ops. Since Security is a position likely to involve combat, it shouldn't be surprising if it's the most dangerous.
Straight number of deaths doesn't really matter in this case. Each red shirt is statistically less likely to die than the other shirt colors. The only reason the straight number of their deaths is higher is because there are so many more of them. Like, you wouldn't say that living in America is significantly more dangerous than living in Brazil, even though we have a higher number of deaths. It's only higher because there are more of us