Because the coffee has a ridiculous markup on it, and they are brilliant at marketing. Microwave breakfast sandwiches with names like "Double smoked bacon and egg". Frozen pound cake for 3 dollars a slice. Lattes for up to 5 dollars each.
And a constant flow of customers and it being just uncomfortable enough for people not to stay too long.