If you believe that, go set up a "Free Candy!" stand at a local playground and see how long before the police show up.
This is a sign of a broken community. Handing out candy is absolutely fine as long as the kids are old enough to understand their own allergies and limits.
Counterpoint: Halloween.
Most kids are competent enough to manage their survival in such circumstances. Some are not. And sometimes it’s not the parents’ fault. But if a community is raising a generation too imbecilic to choose if they can eat chocolate, their life path is sort of already written.
The better comparison is what if there was a bottomless bucket of candy in your 10 year olds room all the time.