Penal legion
Penal Legions are regiments of the Imperial Guard composed solely of criminals. Instead of serving a very long sentence these men and women have been given the once-in-a-lifetime opportunity to fight and die for the Imperium, thereby wiping away their past sins and allowing them to achieve the Emperor's peace. The Penal Legions are most probably inspired by similar Soviet units in World War 2, though prisoners have been fielded by many desperate armies over the course of history. France conscripted criminals to fill the trenches during World War 1 for example while medieval galleys were sometimes rowed by convicts.
Needless to say, Imperial commanders tend to use Penal Legions as an expandable resource, even more so than normal regiments. Penal Legion soldiers hooked up on chems and sent on suicide missions is a major source of Grimdark, which 40K runs on.