The carpet industry is still growing worldwide, but it’s not the most popular flooring type (source).
Homes with hardwood floors sell for more. Buyers and real estate agents prefer a home with hardwood floors. It’s also much longer lasting; a hardwood floor can last over 50 years when maintained.
On the other hand, carpet is much more affordable than hardwood which is why many people opt for it. It’s also cozier, so it might be preferable if you live in a cold area.
Overall, carpet is still quite popular for bedrooms, but it’s losing its dominance in living spaces. And it’s definitely out of style in bathrooms and kitchens (thankfully)!