It's edible, you can spin its fibers for cloth, you can make oils with it. So why did people (by and large, I know it is still grown today, but it's hardly ubiquitous.) drop it in favour of other things?
Flax was first used in ancient Mesopotamia, and linen wrappings were used in Egypt to wrap mummies.
For a long time, linen and wool were the two main textile fabrics.
The market share of flax fabric has declined as other textile yarns became more available. Silk replaced linen as the luxury clothing fabric in the Mediterranean either imported from China, or, after the Byzantines smuggled silkworms back to Europe, locally produced silk.
The next yarn to challenge linen and erode the market share of flax was cotton. This was originally imported to Europe from India, but later (and more cheaply after the invention of the cotton gin) from the Southern USA, and then Egypt and other regions.
After that came a variety of synthetic fibers.
Flax is a fairly expensive crop to process into textiles (it has extra processes involved, such as "retting" that other fibers do not).
So, once linen was the main "lighter", "smoother", "cooler", "stronger" (which is why it was used to make sailcloth canvas) alternative to wool.
As other fibers were introduced, they were cheaper, they wrinkled less, and they gained market share. Cotton canvas, for example, generally replaced flax canvas as sailcloth during the first half of the nineteenth century.
Eventually, flax fiber was only left with niche markets in textiles. This reduced it's relative value as a crop and it became somewhat of a specialist market.
Linen was phased out of textile manufacture mainly because cotton could serve the same purposes more cheaply.
During the 18th century, many European countries had their own linen industries, with dozens of different varieties with minute gradations running from very very fine to extremely coarse. The finer types were primarily used for more affluent men's and women's underclothing, shirts and shifts, with the finest and most transparent saved for making ruffles on the same; middle weights were used for simpler underclothing, outer clothing - painted for the wealthy, printed and checked for the rest - and linings; heavier linen tickings and canvases were for hard-wearing laborers' breeches and trews and non-clothing uses (sails, mattresses, etc.). By contrast, cotton had to be imported from the East Indies as an opaque, painted/printed fabric or a sheer muslin, both very expensive; long-staple cotton was also grown in the West Indies and along the coast of some of the southern American colonies, but the fiber was shorter than that of linen and harder to spin, and the growing season was very long. Linen's own disadvantage, that the production time was extremely long (the plant has to be left in standing water to rot, for one thing), was less of a problem than cotton's.
The introduction of the cotton gin in the 1790s meant that short-staple cotton, which had a shorter growing season - meaning that it could be grown in many more places - could switch from being a small-scale household crop for personal use to a very profitable enterprise. This then had a huge influence on the economics and future of slavery in the colonies, and led to a dramatic drop in price for cotton. Suddenly, a white cotton gown was within reach of many women, rather than a complete luxury, and going into the new century more densely printed cottons started to take the place of the middle weight dyed/checked/printed linen for outerwear, and white cotton for linings. However, linen was still overwhelmingly used for underwear.
It wasn't until the boom of the 1850s that the amount of cotton produced pushed linen out, and you no longer see the latter used in extant clothing (until the rise of luxury leisure clothes around 1900). By that point, linen's disadvantageous production process was simply outdated compared to the industrial way cotton was dealt with.
edit: This took me such a long time to write, what with one thing and another going on off-computer, that I didn't realize I was essentially reposting information that was already here. Sorry!