Oh yeah, I think it's time to talk a bit about this topic.
I do not think many foodies would state they have had good experiences with coffee in restaurants. It is pretty common to expect 'diner quality' even in the most expensive or highly reputable restaurants.
The simplicity is that a handful of roasters/distributors deal with cafes in our area and there is not a lot of investment in the actual service of the coffee. I often hear the catch 'we serve X roaster' as a statement of quality. The truth is that brand is only as good as the training and support behind it. Unlike wine, coffee is not bottled and ready to serve, it still has prep which could be the difference between a decent cup and the dregs.
The simple truth is that it's easy to serve a decent cup. The problem is that issues often need to be solved before the service is even addressed. Water quality, grinder/brewer servicing, and of course a good cleaning are typically in need. Often management/ownership want the coffee to fit into how the service/brewing currently exists. It limits the ability for a good cup because there is already some preset method where only certain roasts will come out acceptable. This is especially true for restaurants which may have a musical chair service on the espresso machine where every table server is serving 'frothed' milk. There is very little consistency in this approach. You can tell at this point where my espresso bias comes into play.
Fresh roasted, fresh ground, fresh brewed. Those are the very basic tenants in coffee even before good green and the roaster's skill are a factor.
Few cafes have all three, so it would be hard to think restaurants would trump this without guidance. Most roasters widely distributed here in town hide the roast dates in the fold written in codes nobody understands, or tiny 4pt fonts on the bottom of the bag, or just simply no roast date. Add to that, mystery 'custom blends' which may or may not be custom because you just don't know what's really in it. Then you have contracts and leasing programs which simply encourage the shops/restaurants not to service equipment they don't own. Add to this, a high volume discount approach which throws actual hands on training and legitimate service to the side in favor of 5 pound bags going stale. Service is then an afterthought because of cost or lack of time dealing with so many accounts.
Restaurant service doesn't have to be some uber elite premium special coffee but at $7 a pop, it shouldn't be stale pods either. A simple service of a fresh roast from a local roaster would probably satiate most post meal coffee drinkers. Fresh ground in small batches or simply brewed on demand in an easily repeatable method. A single estate coffee of personal preference to the head chef or something with a little more story would be the next step up. A few restaurants doing something simple and tasty would go a long way. Then someday, you will start to see more per cup programs that pair single estates with matching desserts in progressive restaurants. Then dare I say it, fancy brew methods prepared with flare and skill in front of the patron.