WASHINGTON — A federal judge in Texas on Thursday excoriated the Justice Department, demanding ethics classes for the department’s lawyers and ordering other sanctions for those who argued the case involving President Obama’s immigration executive actions.

He also ordered the government to produce a list of about 100,000 immigrants who entered illegally and who are participating in a government program that protects them from deportation.

In a blistering order, Judge Andrew S. Hanen of Federal District Court in Brownsville accused the Justice Department lawyers of lying to him during arguments in the case, and he barred them from appearing in his courtroom.

He also demanded that Attorney General Loretta E. Lynch provide a “comprehensive plan” within 60 days describing how she will prevent unethical conduct in the future, as well as making sure the department’s Office of Professional Responsibility effectively prevents misconduct among its lawyers.