Cotton yarn is great, if you choose the right project!
Cotton has a lot of great qualities. For one thing, it is endlessly durable in the laundry machines. Unlike superwash wool, which even though you CAN wash it in the machine, my experience is that if you wash it very often, or in hot water, it will felt and pill like crazy.
But I have a stack of dishcloths that go through the washer and dryer on a weekly basis, some of them for years. I often get rid of the musty mildew smell by adding half a cup of Pine-Sol (original formula only) to the washing machine. They fade eventually, but they keep scrubbing my dishes, so that's the important thing!
For another thing, cotton is great for people who are either vegan or who have allergies to animal fiber.
It must be said that, ecologically speaking, cotton is one of our worst crops. It requires the most pesticide and irrigation to grow, and the most horrendous chemical overhead to process. Even an "organic cotton" yarn may only have been dyed with organic dyes - it doesn't necessarily mean that the cotton itself was grown organically.
On the down side, cotton droops like crazy. It also absorbs water like crazy. This makes it completely inappropriate for knitting or crocheting bathing suits, unless you only plan to wear it poolside and never jump in the water! Cotton also tends to be heavier, inch for inch, than wool yarn.
If you try to substitute cotton for wool in a sweater pattern, for example, you could be in real trouble. The sweater will be heavier than wool, and this added weight will only encourage it to droop farther. When I was in high school, I bought an Aran sweater made of cotton… by lunchtime, that thing would already have drooped down to my knees!
Because cotton is stiffer than wool, it can be more difficult to knit at a tighter gauge. Fortunately, cotton tightens up when you wash it in hot water. I always knit my cotton goods a little bit loosely, then give them a run through the machine on hot to tighten them up. (Practice this with a gauge swatch first, to make sure you hit your target!)