Vinyl sucked when CDs were introduced (unless you were buying audiophile pressings at twice the price). Between the warpage, off-centeredness, stitching, orange-peel, factory scratches, mangled sleeves, and other defects, you were more than lucky to get a good copy. Nowadays, vinyl is mostly pressed with tender loving care and on heavier discs. Colored vinyl is much more common now. But the capacity for present plants has pretty much been reached and QC is reportedly declining. Replacement parts for presses are getting hard to come by. The need for more capacity is obvious but the cost of investing in new machinery is enormous. While sales for vinyl have gone up for several years now, the rate of increase is plateauing. This means that investing in new capacity is even riskier.
When CDs were introduced cassettes were already outselling LPs nearly two to one (because of the Walkman) and the difference was expanding. So it was an obviously correct business decision to reduce LPs to make way for CDs.
Early CDs suffered from a dearth of engineers familiar with digital audio. Yet record companies quickly issued their catalogs on the format to take advantage of its exploding sales. This led to many releases suffering from bad sound because shoddy later generation masters were used and they were not properly mastered for the format. By the mid 90s there were many more engineers properly trained in digital audio and the technology had vastly improved. Many remasters sounded much better than their initial releases. But the loudness war was gearing up, as well as MP3/Napster and the vinyl revival.