Cash is fungible, but it's unclear whether stocks should be fungible in the same way.
Eg it's common in some tech companies to give the founders super-voting stock that reverts to normal stock on sale.
When you buy a share from the open market, they are not going to guarantee a particular share with a particular serial number you specify, they will only provide a number of that particular class of share of the company.
Most companies decide to make their shares fungible, because they want them to be readily tradable.
But there's no one forcing anyone here. Companies and investors could agree to shares with particular serial numbers.
It's just so much more convenient to have fungible shares, that this is where all the capital goes.