In simple terms it is all a matter of risk and cost. The crab does not have to use up energy and body resources making a shell of its own. The risk is that it is vulnerable if it outgrows its current shell and cannot find a suitable larger one nearby. Evolution has gone down this path where there are plentiful resources (ie discarded shells).