That bag of flour has probably been in there for a while, yes? Flour beetle eggs can make it through the milling process and hatch out in the bag if it hangs around long enough.
They were already in there and you didn't realize. You can sift the flour and the bugs won't go through the mesh, or just toss it and get a new bag of flour. It's three bucks, not a big enough deal to raise a stink over, especially if you've had the bag for a long time. Beyond a certain point it's on you, not the store or the manufacturer, to ensure that the food is of good quality, and in my opinion (and my climate) it's anything over about three weeks. Anything longer than that and the other entities involved have had less influence on the food's quality than you have.
I keep my flour in the freezer until I'm ready to open a new bag, and it stays in an airtight container on the counter.