The boards did have 4 smooth surfaces, all perpendicular to each other, and were straight. That was when they came off the mill, though. Since then, they've been exposed to the elements, shipped to the store, handled, etc and nature has taken its course. Each board is different, which is why they all "acclimate" differently.
There are three main solutions
- Run the boards you get through a jointer and planer to straighten them as you would rough-sawn stock. This can be with hand or power tools. Generally not a solution for a beginner woodworker though, at least on the power tool side.
- Spend some time at the store picking out the straightest, flattest, best-looking boards they have - going back multiple times or to different stores if necessary. I spent an hour at the big-box store looking for 1x boards for a project, and only wound up buying 10 or so. I looked at every single 1x3 and 1x4 they had, though.
- Buy bigger boards than you need, but be less picky, and cut off the parts that are twisted, kinked, not flat, etc. Sometimes the majority of a board is great, but there's a big kink 18 inches from one end - just cut off that 18 inches and you're good to go.
Of course, there is a 4th option, which may or may not be applicable, and that is to buy from a hardwood dealer. Many (most?) will mill for you (for an extra charge, of course; one near me charges an extra 50 cents per bf), so you can buy exactly what you need and get it S4S, ripped in half, whatever. Don't let it sit too long, though, or it will likely wind up just as warped as the stuff at the big-box store.
ETA: A 1x2x8 is about 1.4bf. Walnut at my local hardwood dealer is $5.00 per bf at the most (I don't remember exact prices), so you're looking at a total price of about $8, even with the milling. Compare that to the $25 that HD wants for the same board!