I'm going to let you in on a little secret; restaurants love it when you order wine by the glass. And not in a 'we love this customer for coming in and ordering wine', it's more of a 'we love this customer for adding to our cashflow'. This is due to a bunch of factors, but basically, wine by the glass can take you for a ride. Here's what to consider for this ride.
The consideration with wines by the glass is that they are often where restaurants make the most profit. How so? Because wines by the glass generally sell for what the restaurant purchases the bottles at wholesale. So that $5 glass of red you ordered was bought by the restaurant for maybe $5 a bottle and with about four glasses of vino to a bottle, that resto just made $15 in gross. If you really want to drink wine and are out with friends, get a bottle. You'll find better wines and better value.
Here is another thing to consider; wines by the glass programs aren't always based off that price/wholesale cost ratio. Often, a markup occurs based off of popularity. I was out and noticed a few groups around me. What did the majority order? Chardonnay. And that Chardonnay was the most expensive wine by the glass. And it wasn't just that restaurant. I've noticed numerous places where Chardonnay is the most expensive by the glass. Restaurants know that Chardonnay will be ordered without a second thought. In fact, Chardonnay is probably the most popular wine in the US; so restaurants know this and can't wait for you to order it by the glass. Cha-ching.
Other considerations for the wine by the glass value conundrum is that these bottles of wine can often be leftovers from the previous night. Which isn't always a bad thing as some reds can benefit from air. But take note of the freshness factor. You can still find some good stuff by the glass, just be sure to ask your server (or even better, the restaurant's sommelier) and talk to them about what you're looking for.
The best way to navigate wines by the glass is to get a bottle. The second best is to look for wines from emerging regions like Spain, Austria, Portugal, etc; great values can be had from areas that are a bit more obscure. All of these factors play a part in a wine by the glass, but in my jaded wine nerd purview, I tend to avoid wines by the glass. My favorite way to deal with wines by the glass? Get a cocktail.