Quite a stupid concept, really. True, one can't sell what one does not own. But even selling a stock where the buy transaction has not settled should purely technically speaking be OK because selling the stock also does not obligate to deliver the stock right away but 2 days later. The entire settlement process really is an antiquated dinosaur and highly inefficient but nobody wants to change because it costs a lot.
There was 5day settlement until. 1993. Later these was 3 day settlement followed by 2 day settlement, The financial industry does not makes these changes until they are mandated by the SEC. If the industry had its way we would still have fixed commissions and 1/8 minimum spread on quotes. The industry complained bitterly but profits rose substantially because of increased volume.