America is unique in that their culture has only fairly recently outlawed explicitly, institutionally treating people of other races as lesser than whites, as a result of longstanding cultural traditions and norms to justify centuries of have race-based slavery. (The only way you can have massive slavery of a specific race of people in a society and have that society not view it as a complete aberration is if they somehow normalize and justify it to themselves.)
In this context of a country has had, until very recently, explicitly government sanctioned discrimination on the bases of race, it makes sense that even though explicit discrimination is no longer allowed laws may still be passed that are designed to implicitly be government sanctioned discrimination on the basis of race.
> America is unique in that their culture has only fairly recently outlawed explicitly, institutionally treating people of other races as lesser than whites
USA is far from unique in that regard, certain commonwealth countries have the same issue.
>Countries without a significant black or latin american population have the same laws
There are international laws stating marijuana should be legal for medicinal use only, which the US is largely responsible for. Countries that don't want to piss off the US have little choice.