Why can't "sandwich" be used as an uncountable noun, like "pie"?
Solution 1:
Building off of @aparente001's answer, I'd argue it has to do with divisibility (which is related to countability).
For example, cake and pie work well with your example I like pie/cake best. Sandwich, on the other hand, doesn't work quite as well. Typically, one would say half a sandwich, or a part of a sandwich when speaking of dividing it.
Solution 2:
Having thought about your interesting question, I would say it is related to how sandwiches are prepared. I tried to list some more words like "sandwich", and here's what I came up with:
cookie, biscuit, roll, bun, crescent, hot dog, pancake, cupcake, crepe
Think about how you would make these. I have made all of them except for the hot dog, and even there I can imagine it, because I had a friend who had worked as a traveling pork butcher in rural Mexico, and she described the sausage making process to me in detail.
When you make biscuits (the U.S. kind, not the British kind), you roll out the dough and use a floured biscuit cutter or an upside down teacup to cut out a bunch of round shapes. How many biscuits can you get out of one rolled out piece of dough? It's necessarily a discreet number. How many biscuits can you fit comfortably on one baking sheet? When you are making biscuits, you think about this. You think about the array you are making. Maybe you make alternating rows of four and then five biscuits per row. Five of these rows give you 23 biscuits. You compare that against what the recipe said -- "yields two dozen biscuits" -- and you feel reassured that you rolled the dough out to the right thickness.
I could go through a similar description with cookies, about how you use the two spoons, and so on. And to make crescents, you roll out a circle and use a knife to cut it into eight wedges, and then you roll each one up and give it a curved shape. By now you are hopefully motivated to go put on your apron, preheat your oven and open up your Joy of Cooking.