The issue isn’t that bugs get in, but that bugs are already in. Weevils will lay their eggs in with the flour, which are impossible to sift out. Unless you bake them at 140°F/60°C, freeze them at 0°F/-18°C, use pesticides, or deprive them of oxygen, they’ll eventually hatch and eat your flour/grain.
Hah, for once, a benefit of having celiac, no wheat for me apparently means no weevils for me. I mix up a lot of gluten-free flour mix to substitute for all-purpose flour. It's a mix of way too many flours and starches (white rice, brown rice, sweet rice, potato starch, potato flour, ivory teff, tapioca starch, arrowroot flour) that I got from a blog many years ago, and haven't tried to slim down because it works great for me. Never had any bug issues; maybe specialty flours have better quality control.