Sandwiches were actually invented so an Earl could continue with his gambling without leaving the table for a meal. Pasties were invented to protect food from coal and dirt for miners.
We've had refrigeration for a century now, no-one's said that we may as well stop eating cheese as we don't need to preserve milk.
Just because food can be replicated doesn't mean that tastes in food may change. You look at TNG, they replicate a roast chicken, it looks like a roast chicken. In theory, they could make a chicken that's just a square block, with no bones, but they like the traditional look.
In TOS they had galleys (In Charlie X they were mentioned as being surprised by having actual turkeys in the ovens). The food cubes were probably simply an attempt at creating "future" food. Something they used or ignored at any time.