Maybe you didn't read the part about a conformist society and yet focused on the illegal immigration part due to your subjective inner bias because you haven't called anyone a racist online in the last 5 minutes.
I never said foreigners commit crimes, as if locals do not, but being very selective with your immigration does help keeping crime lower in every country that does so.
As a country you already have the crime rates of the locals, so you want to not import crime rates as well, therefore you want your immigration being a net positive across the board so you'll have to be very strict.
Japan is also a highly conformist and homogenous society with very little ilegal immigration.