This is a common question among new knitters who have just learned stockinette stitch (knit one row, purl the next). It is the nature of the knitted stitch.
Let us consider the stitch. Remember that a purl stitch is just the wrong side of a knit stitch. A knitted stitch is made of one loop of yarn that has been drawn through the one below it. On the knit side of the stitch, it looks like a "V", and on the back, it looks like a "-". On the front, the V (which includes about 2/3 the yarn involved in the stitch) has been pushed forward in the process of being drawn through the stitch below it. The - that is the back of the stitch (and about 1/3 of the yarn) is forced backwards when a stitch is pulled through it is the next row. In order for a knitted fabric to lie flat, there must be an approximately equal number of stitches being pushed in either direction by the fabric.
In other words, pattern stitches that have an equal number of knits and purls on either side will lie flat. For example, garter stitch has one row of V's followed by one row of -'s on either side. Seed Stitch alternates V's and -'s and off-sets them by one stitch in each successive row.
Some stitches lie flat by manipulating how the knitted fabric curls. Ribbed stitches alternate panels of stockinette stitch with reverse stockinette stitch. In this way, each rib will try to curl in its own direction. That is why ribbing stretches in an accordion-like manner.
Other stitches curl even though they look as though they should not. Usually, these stitches involve slipped stitches in certain rows, and are called slip-stitch patterns. While many slip-stitch patterns have textures that suggest an equal number of knits and purls, they almost always say "purl all wrong side rows" in their instructions.
Some stitches lie flat when they ought not to, even! Most lace patterns are primarily knitted on the right side and purled on the wrong side. However, the more yarn overs there are in the pattern, the more the fabric will lie flat. This is because of the looseness of the yarn over. Even stockinette stitch will lie flat in a loose enough gauge.
My favorite stitch dictionaries are the Barbara Walker Treasury and her Second Treasury. In both, she divides stitches according to type, including knit and purl patterns, slip stitch patterns,yarn over patterns, and lace patterns. When stitches are reversible or look interesting on both sides, Ms. Walker usually makes a note of it.