Some tenants are there for life, but others decide to buy (perhaps the ones who would have bought their rented house?) or move to another town to work, or move in with their children, or into a care home. Even the ones who stay for life are not there into eternity, as life itself is not eternal - sooner or later they will need their home no longer.
Once a house is sold out of the social housing rental system, it is unavailable permanently (and often ends up after a few years as another house for sale, while its first owners trade up), replacements takes ages to build and are costly, and land elsewhere has to be bought on which to build them.
Meanwhile people who need houses wait on an endless list.