It would be nice if CostCo allowed people of low income to apply for a financial aid in the form of free membership if their income was low enough. It's unfortunate that only the people with greater purchasing power get access to the lowest cost per item unit.
The membership is the per member profit. Costco doesn't mark up items more than 14%. In some states they aren't allowed to require membership to access the pharmacy. If what you proposed was workable, I'd expect groups of people in an area to band together or have a middleman in order to only have one membership and break up bulk items.
(And technically there is such a middleman doing their best to lower prices - they are called Walmart.)
> ... greater purchasing power get access to the lowest cost ...
Same thing happens with the US health system - the uninsured pay the most for exactly the same procedures at the same place. At least in the case of Costco it is economically sensible because buyers purchase a bigger volume and the store has greater throughput. (Costco typically has 4,000 SKUs per store while a normal supermarket will be around 16,000.)
CostCo's profit is the memberships. It is a smart business model that is very successful. It just isn't designed for people who are living hand-to-mouth. Nothing wrong with that, its just how it is.