I wonder if there is a financial reason for the rule and if they receive reimbursement for each child to whom they serve lunch. Regardless, I would approach administration and ask them to make an exception for your child.
I know in my school the state partially funds it and they mandate the rule that no home food can be brought in unless there is a doctors note but the state also mandates that the meals be healthy and balanced . It's not in the schools hands .
Eta - but there is always exceptions to every rule and that's why I would talk to the admin.
Honestly, at this point I would email teacher along with administrators and maybe some board members and tell them "too bad", they are not forcing your kid to eat.
Its 2019, with all that we know about food issues and sensory issues, you would think they wouldn't make this a battle.