He is not "stealing" and should not be punished. Calling it "stealing" is unfair and unjust. I would take him to another school, or no school at all. He should be in an environment where other kids don't eat unhealthy junk, and he should be supported with his special diatery needs.
I have one child with serious allegries, so basically the whole family is on his diet, which is very healthy anyway. Protect him from exposure to food that isn't good for him. Don't expect him to resist the temtation. That's too much to expect. It is our duty to give him an environment that supports his health.