ALLENTOWN, Pa.—One of the chief strategies in President Donald Trump’s battle against illegal immigration is being undercut by an unlikely figure: a New Jersey native named Ernesto Galarza.

In 2008, Mr. Galarza was doing construction work in this eastern Pennsylvania city when his boss allegedly sold drugs to an undercover police detective. Mr. Galarza was arrested along with the boss, and booked into the Lehigh County jail.

Mr....