Usually when an eletric car battery goes wrong, only a module do so and you can replace the broken module and balance everything. So you can make good battery packs using bad battery packs.
Second step is to use the battery for something else that is less critical on energy density. If a battery pack holds only 50% of its original capacity, it's not very nice in a car but you can still use it for energy storage at home for example. Also if you have a 100kWh pack, you usually need 110kWh to "fill" it. But if for some reasons this battery pack deteriorates to 50kWh, you will need 55kWh to fill it. In other words, an old battery pack do not waste energy compared to a new one. It just represents a lower potential of energy. Of course you have things such as internal resistance so the efficiency may vary over time, but it's not an efficiency disaster.
Last solution is to recycle. It's not very developed because the amount of eletric car batteries to recycle isn't that high yet. Today a solution used at least in France is quite simple, you burn the batteries in a large oven and you keep the melted metals. You have to filter the fumes and the cobalt is lost. But you get lithium, that may be more expensive than lithium extracted from a mine. Another process I heard about is about crushing the batteries and filtering them instead of burning them.