To make or to buy.
First there's just flat out buying a bunch of them. Tamiya (the model making company) makes a load of 1/35 scale World War II military items including tank traps and sand bags. It's item # 35025*300 (last I knew) and their sand bags are 25mm x 12mm and about 5mm thick.
The sandbags are hollowed out underneath making them light weight, and are made of standard modeling plastic so they can be glued together and painted easily using standard methods. These should be available any place that carries the Tamiya line of military or car models and come with about 40 sandbags to the box.
The second and alternative method is making your own out of clay or epoxy resin as others have suggested, but I've got a few extra tips that will help you out...
What you'll need.
Clay, putty, or other mouldable material that can be moulded by hand Piece of old T-shirt cloth material (or other expendable cloth material with a surface texture you'd like on your sandbags. Scissors. Pencil, or other item with a small narrow tip or edge - the narrow edge of a screwdriver would work too. A flat surface to work on, and a cookie sheets or other item to bake your clay on as needed.
Rolling and sizing
Roll out your clay or putty in long tubes by rolling it between the palms of your hands. Try to keep the tube roughly the same diameter along all of it's length so that your sandbags are all approximately the same size.
Getting your tubes consistently sized and rolled out so that the sandbags come out the size you want takes a bit of practice - don't hesitate to practice first with PlayDoh or children's oil based (non- drying clay) until you get a bit of practice at controlling the size.
Flatten it out most of the way (again - I make my sand bags about 20mm - 25mm long by 12mm - 15mm wide, and about 5mm - 7mm thick.) Don't flatten it out completely - yet.
Once you have the tube mostly flattened - wrap it in a piece of old fabric with a surface texture that you'd like for your sand bags - I find most old T-shirt fabric is perfect for this and usually easy to come up with on short notice. With the fabric wrapped around your clay - finish pressing the clay into the final thickness desired for your sand bags and then CAREFULLY remove the clay from within the folds of cloth.
Once you have your clay flattened and textured, here's where the scissors and pencil/pointed object come in. Starting at one of the short ends, measure in 4 or 5 mm and snip off a piece of clay with your scissors. This should leave you with a < sort of shape to the end of the clay.
Move down the clay roughly 20mm - 25mm (the desired length of your individual sandbags) and snip with the scissors again. This should leave you with a single sandbag with < and > shaped ends when viewed from the side. Repeat this by moving down your clay 20mm - 25mm and carefully snipping off pieces until you run out of clay. You should now have a bunch of individual sand bags.
The next step is to take your pointed object and scribe a thin line in the clay down the length of each of your long sides (not the top and bottom) of your sand bag. This line represents the seams in the sides of the cloth sandbag. Once you done that for all your bags, you then want to model the effects of gravity.
To do this, use your fingers to carefully bend downwards the < and > ends downwards to simulate the effects of gravity. (Unless of course you're Games Workshop and have the 'anti-gravity' sand bags that hover in mid-air when used to form rooftops without any supports underneath them). If the clay you're using tends to pick up your finger prints - then simply wrap the cloth you used to texture your sandbags over your fingers when you bend down the ends. You should now have a pile of fully textured, seamed, and sort of floppy looking sandbags ready to be assembled into their final shape.
You now have a couple of final choices to make. You'll need to decide if you want to put your sandbags together into low walls before they dry/harden, or leave them as individual bags and glue them together afterwards. (Note: If you are using clay that has to be baked - place aluminum foil or other expendable material on the cookie sheets before you bake your clay on them. That way any noxious materials in the clay won't end up on the cookie sheets - thus incurring the wrath of your Mom/Wife/significant other.)
Personally I like to make low walls, bunkers, etc, before they dry, because I can bend downwards any of the end pieces that stick out (again - remember sandbags don't normally defy gravity.) I tend to like making a few larger straight wall sections and some C shaped bunkers, along with some smaller straight wall sections and some L shaped sections for the sides / corners.
These small parts give me some flexibility when it comes to setting up my terrain on the table top, and allow me to add them to the larger parts so I can create large bunker setups, etc. Since I want my sandbags to stay together once I model them into walls etc, I take my small pointed object and make criss-cross patterns in the sandbag surfaces to be joined. Make them small areas in the middle of the tops and bottoms so they can't be seen when the bags are stacked, and simply gently press them together, and stack a final row on top, bending downwards any sandbags sticking out the ends as needed. Then bake or allow to air dry as needed. To date, I haven't had to glue or repair any of my sandbag walls made this day. Once the sandbags are dry, you can paint as needed.