The soldiers were recruited mainly for their language skills or medical training. Many speak strategically important languages like Chinese, Korean or Russian. Many have college degrees, and some are medical doctors. More than 10,000 troops have joined the military through the program since it began in 2008, almost all of them serving in the Army.

In recent years, though, the Defense Department has tightened its vetting of immigrant recruits. Now, soldiers joining up to be clerks, mechanics and surgeons face the kinds of extensive background checks that were formerly conducted for troops who needed top secret clearance. The added layers of scrutiny include screenings by the C.I.A. and F.B.I., a review of at least a decade’s worth of personal finances, an exhaustive questionnaire and numerous lengthy interviews.

The new requirements made processing each recruit take much longer, and the backlog of reviews piled up into the thousands. Many recruits have been waiting for years to get the clearances they need to advance in their military careers, and in some cases, Ms. Cutler said, the process has dragged on so long that screenings done at the beginning have since expired and must be done over again. Then the Army started pushing the recruits out.

“They were being discharged even if there was not a security concern,” she said. “These are often highly skilled individuals, many have master’s degrees.”

In a court filing in July, government lawyers called the Mavni program an “elevated security risk,” and said that some recruits had provided false information to obtain student visas and that others had friends who were associated with foreign intelligence organizations.

However, a 2017 report by the RAND Corporation found no evidence that the Mavni program had caused any security problems. The report, which has not been officially released, found that the program’s recruits were generally better educated and performed better than the average enlisted soldier, and had not been involved in terrorism or espionage.

The military may want to curtail the Mavni program simply because it has become an administrative headache, clogged with too many regulations, said Margaret D. Stock, a retired lieutenant colonel in the Army Reserve who helped create the program and is now an immigration lawyer representing some Mavni soldiers.