They did. The case was Medellin vs. Texas. Ted Cruz argued in front of the Supreme Court that the State of Texas had jurisdiction. Texas won. They executed him.
Of course they did, because a crime was committed.
The man was still a citizen of Mexico and officially a ward of that nation.
A normal person coming here from Mexico is not instantly a ward of the United States as soon as he steps foot on our soil. He is still officially a citizen of Mexico, and a member of their society, although temporarily on our soil.