You have the option to recycle your carpet at dedicated local recycling centers. Be aware that an additional fee applies due to the work of shredding, washing, sorting, and processing the fibers. You can also ask local carpet manufacturers to determine if they accept drop-offs.
Another option is donating your carpet to Habitat for Humanity to repurpose it for use in their charitable home-building projects.