I was reading a blog by someone who is building their house as sustainable as they can afford, and the issues they had with choosing a carpet. There aren't a lot of environmentally friendly options in Australia, from my experience as a commercial and residential architect. Sure a lot of companies use sustainable materials where possible, reduce their production impact, and have started take-back schemes. The latter is great, but only works if the company is still around in 20 years, and previous owners pass on to new ones the company details for when they eventually rip it up.
Carpet is also driven by trends, so old styles can look dated and may never get purchased.
Carpet cleaners use nasty chemicals, natural materials in carpets can stain, glues may be used for installation. It goes on.
I believe the best option these days may be to have a hard floor surface, such as concrete or bamboo floorboards so you get the benefit of thermal mass, and add rugs! Rugs are great, moveable, washable, add warmth and colour. They can be made in small communities, purchased from fair trade organisations and keep quality handmade skills alive!