It's not justice, but the same phenomenon. If certain group has a larger tendency to commit crimes, and you have limited time and resource to look for crimes, it's overall more effective (arrest more people and perhaps prevent more crime) to disproportionately target that certain group. Men and blacks do in fact proportionally commit more crime than women and other races, but less so than the rate of incarceration suggests. There are only two ways to prevent this: being super effective and checking everything (police state), or being less effective and arrest less criminals for taking extra steps to arrest in just proportion (there are legit reasons to want this, e.g. it'd be terrible for society if for example white women had the sensation they could commit any crime without punishment. But to what degree is that extra effort worth it?).