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.