When that happens, infection sets in , and generally kills the animal. So evolution could not select to get rid of the food grinding organ, because of this problem, this flaw, of the opening becoming dangerous if randomness selected for it to become even smaller, for it to go away altogether. In humans, our crops, which we call 'appendixes' are as small as they can get before grains are likely to get stuck in them and block them up. They hang there, useless, off our intestine. It just did not kill them often, because it did not happen often.
Nature only does 'good enough'.
It is never perfect. If the rare person dies, no big deal to Nature. The same is true of the way civilization has evolved over time. No one is planning civilization, is just grows and changes over time. Once, before medicine, most babies died.