In just about every fictional medieval fantasy setting, arguably the most booming and economically profitable industry is the hospitality industry. Don't believe me? There's a tavern in just about every village, no matter how backwater or isolated said village is.
If you think that doesn't sound ridiculous, then, please, just think about it for a minute. the modern-day real-life analogue of that would be to have a hotel (or at very least, a motel) in every single hamlet, every single human settlement, no matter how few inhabitants.
Doesn't sound so realistic now, does it?
Supply and demand
This is basically elementary-level economics. When there's a demand for something, producers will attempt to provide a supply, otherwise the existing supply simply gets more expensive. When there's too much supply with too little demand, prices should drop in theory, but economics are more complex than that.
It's a chicken and egg question - which ones comes first, supply or demand? Usually, it's demand, but there are a few exceptions: for consumer goods, demand is artificially created by technological innovation. No one wanted an iPhone 40 years ago, when they didn't even exist in the first place. Yet, eventually, it was invented, supply was created before there was even any demand for it, and once it became popular, demand grew and grew.
The same cannot be said for goods and services that fufill an individual's basic, elementary physiological needs, like the need for food (to avoid starving to death), the need for water (to avoid dehydrating to death) and the need for shelter (to avoid falling victim to the elements, such as extreme environmental temperature). The demand for goods and services related to these needs is already there for every human being.
What kind of needs do inns and taverns service? What's their business model?
These two questions are essential, when economically analyzing these two similar types of institutions. What do they do? How do they generate profit? How do they accrue capital? What is the nature of their activity?
In a modern context, the words "inn", "tavern" and "pub" are largely synonymous and interchangeable. However, in a pre-modern - especially medieval - setting, they were anything but.
Taverns and pubs generate profit by selling you food and (alcoholic) beverage, and the temporary right to sit on a chair by a table while consuming said items. This may be augmented by services related to various social games, but this is purely optional: the main focus is on the drinks.
Okay, that's that for taverns - what do inns do then? Literally everything that taverns do, plus offering accommodation, that is, rooms for the night, shelter. That's basically the only distinction.
Yet, that's a very big distinction, because it changes the whole business model. To offer accommodation, one has to have empty rooms to fill with beds, the actual beds with all the accouterments (pillows, blankets, etc.), maintenance staff to keep it at least moderately hygienic (even by medieval standards), and possibly even security to prevent thefts. All of these things cost money. But does that money pay off? Remember, if your expenses outweigh your income, you're not making any profit - you're going into deficit, and eventually bankruptcy.
The Inn is NOT a monopoly
The inn does not have a monopoly on accommodation. Yes, I know, it sounds crazy, but really, it does not. Our group of adventurers arrives at a village, or even a smaller rural town. They need a place to sleep. What do they do? The obvious answer might be "book a room at the inn", but there are several alternatives, pretty much all of them cheaper than an inn:
Crash at a friend's place, if you have local friends.
Or, literally just pay any person with a large enough house.
Go sleep in a barn.
The barn's owner - or their children - will probably want to hear your stories, and might let you stay for free.
Even if you have to pay to the barn's owner for the lodging, it's cheaper than an inn, albeit the quality of service is near-nonexistent.
Go camp outside (only viable if you have camping equipment, duh), albeit if you camp too close to human settlement, the guards might enforce their anti-vagrancy laws on you - not to mention, you might get exposed to all sorts of dangers in the night.
If you're on a quest for the government, the government might arrange for accommodations for you, on the taxpayer's expense.
As you can see, the inn has plenty of competition. To be inviting to its intended clients, it has to provide a superior service at a lower cost-to-quality ratio than its competitors. It's hard not to be better than the cold hard ground, but to a party that already has access to a barn, that inn bed better be warm and comfy to make it worth its price.
It does not compute
Okay, so let's say, that your inn offers pristine services at a cheap price. You offer merchants, traveling nobles and weary adventurers a warm and comfortable bed for an unrealistically low price. What then?
You still need customers.
If your village is isolated, backwards, or otherwise doesn't see too much traffic, it makes zero sense to have an inn. But if your village sees so much traffic, then why is it still a village?
A small fishing village sitting between rock mountains and an ocean is not going to have an inn. A town or city located on a river delta flowing into the ocean, connected to other towns that produce lots of goods, however, will have plenty of inns to accommodate merchants coming from those places, and abroad as well. If we take our fantasy adventurer heroes out of the equation, a human settlement's likelihood of having even one inn to begin with - let alone multiple - is directly correlated with the amount of economical activity that takes place in said settlement, especially if said economical activity is trade.
Don't you have it backwards though?
I just said that large settlements (towns and cities) should have inns, while small settlements (villages) shouldn't have inns, because they don't feature much economical activity, and the typical merchant - or adventurer - passing through will likely just be fine with the local barn.
Okay, but aren't we now putting the cart in front of the horse?
It's not that villages have low economical throughput because they're villages, but actually, the other way around: villages remain villages due to the low economical activity. Villages actively engaged in lots of trade - whether domestic or foreign - will, inevitably, grow into towns, and eventually cities.
If a new trade route comes into existence, and suddenly lots of merchants are constantly passing through a village, the local barn-owners may eventually get fed up with constantly having to lodge travelers in their barns, and we may see the building of some inns to accommodate for them. This creates new jobs, which sucks people from the surrounding rural areas into the growing town, and as population (density) increases, the aforementioned village gradually grows into a town, and eventually a city, partially due to the hospitality industry.
So obviously, not every village should be bereft an inn - the ones in the process of growing into towns due to trade, obviously should have inns. However, villages that sit in the middle of the empty land and barely have any traffic at all, should not have any inns.
As a general rule of thumb, villages located by rivers are far more likely candidates for growing into towns (and thus having inns), than villages having no water connections.
It makes for more interesting scenarios
You all meet in an inn. It's such a cliché, that there's literally a TvTropes page about it. Obviously, tropes are just tools, so a single cliché shouldn't ruin anything by itself. However, it is such an overused trope, that surely, we can find something more exciting by exploring the alternatives.
Inns inherently "gamify" roleplaying sessions and stories, even when said sessions or stories are intended to be realistic. If we take the ubiquity of inns out of the equation, and try to approximate reality better what we have is:
Adventurers having to account for the dangers of wilderness not just when actively adventuring, but also when camping, sleeping.
Adventurers having to actually engage with (NPCs who approximate) real people, use their social skills to bargain the price of staying at the barn by the night.
Adventurers having opportunities to brag about their adventures to the owners of the barn, or their children
The relationships between adventurers and the quest-givers being more fleshed out. When the government hires the adventurers to do something somewhere, does the government cover accommodation costs? Does the King give you a certificate to show at a local castle to let you sleep in a reserved room in the castle?
Adventurers having to be picky about where they are adventuring. If you go adventuring in a backwater rural area, you better get used to there being no inns, and instead having to convince some local farmer to let you crash at his barn. Meanwhile, if you go to a city, having a local friend with a big house might be a cheaper alternative to going to an inn.
So why not try it?
Is it wrong that I had the anime Spice and Wolf firmly in my mind as I read this?