During the Depression (1929-1939) few people could afford to buy new clothes, so they did what any penny pincher would do—they used whatever material they had on hand, which in this case was flour sacks.
When flour distributors learned that their sacks were being worn, they started producing more colorful sacks so they’d be more attractive to wear. They also made the flour sacks so that the ink from the company name could be washed out before sewing into clothes.
However, things changed with the onset of World War II. Cotton started being rationed to make uniforms for soldiers, and people were more than willing to give up the fabric in order to support the war effort. From then on, flour was packaged in paper bags — and it’s been that way ever since.