Ignoring the price effects induced by the supply/demand characteristics and intrinsic nature of the good in question (inelasticity of gas demand, in this case) leads to bad pricing as much as incorrectly estimating the marginal utility of a product to consumers.
The problem with pricing Starbucks that way is that a huge chunk of Starbucks strategy involves there being a Starbucks on every quarter, ready for any passerby be they millionaire or middle class, and while it is notoriously easy to do price discrimination within a band of $1-$10 prices, it is very hard to do price discrimination across a $1-$100 spectrum of coffee.
The other chunk of Starbucks strategy is that it's not about coffee.
Speaking strictly of the product (and not the experience which of course is equally important) Starbucks secret sauce is essentially that it is a "sugar delivery system".
I've yet to be in a Starbucks (and I"m in them every single day) where the majority of the beverages that are sold are not black coffee but drinks with a high sugar and even mocha content that are addictive on several levels.
If they could figure out a way to differentiate the product either in taste or image they actually could sell coffee or a coffee drink at a higher price in addition to what they are selling now.
PR wise it could prove strangely to be a bad move thought and might send the wrong message.
This is currently done with liquor to mention only one product where people pay outrageous sums of money for something that is not clearly better (taste tests of grey goose come to mind). And who would have imagined that people could charge for bottled water? Or that people would pay money for luxury ovens? Unheard of back when I was growing up.
The difference is that coffee is a completely different kind of market: producing a small quantity of very good coffee does not give you much help in producing it in large quantities without at a linear increase in the costs (and actually has hard limits based on growing conditions, available labor, etc.) whereas software can be infinitely replicated.
The price of a cup of coffee is useful only in establishing the threshold for how much money the average person is likely to spend without significant thought.
That happens all the time, including for coffee.
Coffee at a "high end" hotel / coffee shop etc does not cost the same as coffee at your local coffee joint --while the coffee itself has marginal difference. And there are places that sell $30 hamburgers (even $1000 hamburgers).
Same for brand name clothing etc compared to lesser known or bargain brands. The cloth / manufacturing quality in tons of cases is exactly the same, to the point of both being made in the same factory in China.
The point of the comparison is that coffee means so little to people that the cost of a cup of coffee is a good proxy for "how much you should spend without thinking".
That it is an imperfect proxy is something that obviously will not be lost on a site full of nerds like us, but s/trees/forest/g.