They had no way to enter lawfully because the United States government allows in few temporary migrants to work in a handful of occupations and there is essentially no green card category for low skilled workers.

Many of these people face the choice of continued poverty in their home countries or taking a risk at a better life working in the American black market.

Police work at the crime scene after eight illegal immigrants smuggled into the United States were found dead inside a sweltering 18-wheeler trailer parked behind a Walmart store in San Antonio, Texas, U.S. July 23, 2017. Ray Whitehouse/reuters

Attempting to work in the United States is risky and sometimes leads to deaths because of immigration enforcement. And more enforcement will result in more deaths.

These immigrants did make the choice to break American immigration laws but it does not follow that they are the ones to blame for their own deaths, despite what some restrictionists think. Immigration laws are primarily designed to stop Americans from voluntarily hiring, contracting, or selling to willing foreigners.

If the immigration laws were concerned primarily with protecting the rights of Americans and those illegal immigrants who died in the Texas heat intended to do harm, had serious criminal records, or there was another excellent reason to think they would have hurt people here, then their deaths could be a defensible cost of a rational system that does more good than harm.

At the very minimum, one could claim that the law that incentivized them to enter the black market at great risk was intended to protect people. But nobody familiar with our immigration laws or the net-positive effect of immigrants on Americans can make that argument with a straight face.

These illegal immigrants died because of an international labor market regulation.

Those who die from the heat in shipping containers are only a fraction of all deaths crossing the border. From 1998 through the end of 2016, 6,915 people died crossing the Southwest border.

The number of deaths is somewhat up over that time even though the number of apprehensions is way down meaning that the inflow of illegal immigrants does not primarily drive the number of deaths (Figure 1).

If the number of border crossers doesn’t determine the number of deaths, what does?

We have a clue in the fact that the number of apprehensions per border death is way down from about one death for every 6,000 apprehensions in 1998 to about one death for every 1,000 apprehensions in 2016 (Figure 2).

That means it is much more dangerous. A greater proportion of border crossers die as the number of Border Patrol agents increases, which is evidence that more immigration enforcement leads to more deaths.

Figure 1

Border Deaths and Apprehensions on the Southwest Border

Customs and Border Protection.

Figure 2

Apprehensions per Death and Border Patrol Agents

Customs and Border Protection.

This is not surprising as research shows more border enforcement leads to more smuggling and higher smuggling prices – both of which increase the riskiness of crossing and, for instance, dying in a shipping container in the Texas summer.

The government’s primary means of halting illegal immigration is through deterrence – creating so much fear in the minds of would-be illegal immigrants that they do not even try to enter.

However, deterrence does not work on everybody. One effect of so much deterrence is that some people try different and riskier ways of entering the United States, such as in a shipping container in the Southwest in the heat of summer. The result is more danger and more death.

Those extra deaths, tragic as they are, might be worth it if the immigration laws save more lives in the United States by preventing criminals or terrorists from entering – but they clearly do not, and few serious people are trying to make that case.

The deaths of people who mean no harm to others is a predictable result of immigration laws intended to protect the American labor markets, culture, or the other justification de jour . It’s time that people start weighing human cost when considering legal reforms.