I have to assume that unless the cost of buying at costco and driving back home is higher than buying it all at amazon and having it delivered.
The total price + driving cost is a good proxy for how efficient the whole process is; amazon will somehow include in the price somewhere the delivery home, and both companies largely won't subsidize their whole business method.
Social value is a little trickier; a lot of people benefit much from delivery, but in the end people probably don't buy everything from amazon or costco anyway.