I would bet dollars to doughnut holes that the school gets federal money for every school lunch it hands out, and they consider a child bringing their own lunch to be taking money out of their pocket.
Bingo.
I am sure they have to reject a minimum number of homemade lunches every day to justify their funding. When they don’t find enough genuinely bad lunches, they start looking for something they can stretch to cover it.