I’m writing this from a hotel room. The word hotel can be traced back to the Old French word ostel, which of course is also the origin of the word hostel. And, it might surprise you, hospital.
Ostel was basically a contraction of the word (h)ospital, meaning hostel, shelter, or lodging. The word hospital, referring specifically to a building dedicated solely to the care of the sick and injured, really only came about in English in the 15th century. When the word was a rougher, tougher place, travelling was a difficult prospect, and people would often need care when they arrived at a rest stop, so inns became places to get shelter, food, rest, and treatment.
In the Middle Ages, dedicated hospitals began to appear, and hotels and hospitals became quite distinct entities.
Similarly-related words, which probably seem obvious now that you think about it, are host, hospice, hospitality, and hospitable!