> "Indoors" lets you store food without insects or other animals getting to it & stealing it.
This isn't true of human doors; insects are very small.
We've had the technology to keep things in wax-sealed clay jars for quite a while, but I'm not aware that this was done with grain, where preventing spoilage would have been most valuable. Granaries are open to the air. (And devote quite a lot of effort to slowing the spoilage of the grain.)
If you wanted food that wouldn't rot, instead of keeping it in an airtight environment, you dried it.