Once debt is deemed uncollectable, school nutrition departments must write it off, but they may not offset the loss with federal dollars. Instead, they must dip into other forms of revenue, such as profits from the sale of full-priced snacks and meals, or they must seek reimbursement elsewhere, usually from the district’s general fund.

Most districts try to collect outstanding balances through automated calls, texts or emails, and they may also hire an outside collection agency. The New Mexico law will still allow schools to penalize students with steps such as withholding a student’s transcript or revoking older students’ parking passes.

Lunch shaming can take a toll on the adults enlisted to carry it out as well as on children. A Pittsburgh-area cafeteria worker made national news when she quit her job rather than deny hot lunches to students.

Some school employees reach into their own pockets to pay for meals. Sharon Schaefer, a former chef at a high school in Omaha, said one cashier asked to be removed from her position because of the school’s “no money, no meal” policy. “She had been secretly paying for students’ meals,” Ms. Schaefer said, “and couldn’t afford to keep it up.”

Even those outside the cafeteria may be moved to help. Private individuals have sometimes paid off the entire outstanding balance at local schools, and last December, a single tweet inspired hundreds of thousands of dollars in donations around the country.

“I don’t think the main intention of the school meal debt policies is to humiliate,” said Ms. Ramo of New Mexico Appleseed, who said the group worked closely with school nutrition departments in drafting the bill. “Mostly, school nutrition directors are trying to balance their budgets and they see this is a necessary but effective evil.”

Nonetheless, she said, “We have to separate the child from a debt they have no power to pay.”

In 2010, the Department of Agriculture was directed to examine the feasibility of establishing national standards for dealing with meal debt, but in its report to Congress last summer, the department concluded that the matter should remain under local control. Accordingly, it directed state agencies to establish a formal payment policy by July 1 or to allow districts to set their own policies by that date. Texas and California have also introduced anti-shaming legislation.

In its official guidance, the Agriculture Department discourages the use of alternate meals and other stigmatizing practices. If an alternate meal is offered, the department suggests bringing it to the child’s classroom in a paper sack so it looks like a home-packed lunch, or offering the same cold meal on the lunch line so it’s available to all students.