A lot of things went wrong Sunday at the U.S.-Mexico border near Tijuana. A small group of migrants who want asylum in the U.S. rushed the barriers in an apparent bid to cross illegally. A few tried to breach the border fence. And some reportedly even threw "projectiles" at American border officials.

These were all bad ideas. Awful, terrible ideas.

But the response of American officials was somehow even worse: They fired tear gas at the migrants, and in the process, they tear-gassed children.

The enduring image of the day is that of a woman dragging a couple of young girls — both clad in shirts, diapers, and little else — as a gas canister explodes behind them.

"We ran," one woman told The Associated Press, "but when you run, the gas asphyxiates you more."

Did this have to happen? No, certainly not.

It's true that the people who rushed the border did something stupid and wrong, and they will pay for it: Mexico's Interior Ministry said it would deport nearly 500 migrants who were involved in Sunday's incident. That's both punishment and tragedy; those migrants will be returned to homes they fled in their effort to escape violence and poverty.

"DHS will not tolerate this type of lawlessness," said Homeland Secretary Kirstjen Nielsen. But let's not forget that Sunday's incident followed a few weeks in which the Trump administration appeared increasingly ready — maybe even eager — to respond with violence to the stream of Central American migrants hoping to head north through Mexico and into the U.S. Trump sent troops to the border, and reportedly sought to give those troops permission to use force to protect Border Patrol personnel. This moment was ripe for provocation — and a few wrongheaded folks took the bait.

There are a handful of questions Americans need to be asking if they're to judge this incident properly: What are the rules governing force at the border? What rules govern launching tear gas across the border, into a neighboring country? Does the presence of children affect how those rules are to be implemented?

It may be that border officials responded properly and proportionately.

But that doesn't change the fact that they tear-gassed children. In the immediate aftermath of Sunday's incident, this fact seems most palpable. It is impossible to ignore. And indeed, wherever you find a debate about America's immigration policy, it seems you'll also find instances of children being treated badly by American officials.

The immigration debate started, really, with children — the so-called "DREAMers" who sought education and work opportunities in the United States after living most of their lives here. It kicked into high gear late in the Obama administration, when thousands of children came north as refugees fleeing violence in their home countries — only to be told by governors in several states they were unwelcome. The Trump administration compounded matters by separating migrant parents from their kids — a policy that took as many as 5,000 children out of their parents' arms. Hovering over all of this is a proposal to revoke the right to citizenship for children who were born in America but whose parents weren't.

The immigration debate is more complicated than we sometimes want to admit. Countries really do have the right and authority to decide which outsiders they will permit to enter. And if it's true that "open borders" is a cockamamie idea, it's also true that closing them entirely is cruel. The good thing is that most Americans favor a policy somewhere in the middle.

But much of the debate over immigration is rooted in a wrongheaded assumption that the people coming to the United States are "invaders" bent on doing the country harm. This is false, but you can draw a straight line from such bad ideas to the decision to launch chemical weapons in the general direction of toddlers.

Perhaps the most important question we should be asking ourselves is this: Do such conflicts make America feel greater or safer or more secure?

I think the answer is no.

We must strive to debate immigration — and hopefully even resolve the conflicts surrounding it — without inflicting suffering.