Most ordinary people don’t have the luxury of a house with a pantry. And many people can only afford what they need each week so can’t stock up even if they had somewhere to store it.
"Pantry" being a metaphor for whatever you have stored away, not a physical room. Regardless of your income unless it is extremely low or you are unemployed, whether or not you live paycheck to paycheck is a function of your decisions, not of your income. You will, in fact, have a considerably larger amount of money to spend, if you don't waste it on small volume frequent purchases.
I’ve lived this small and you get clever. I put things in storage under my bed, in my bookshelf, and in boxes in my closet. Worst case, I would just stack them in the open or on counters, behind the sink, and on window ledges
Whether or not you have a purpose built pantry is mostly just a reflection of the age of the building you live in.
A lot of bottom dollar apartments wind up having unintentional pantries because they wind up dividing a floor of an existing building in such a way that you wind up with a closet in the kitchen.
Most ordinary people don’t have the luxury of a house with a pantry. And many people can only afford what they need each week so can’t stock up even if they had somewhere to store it.