In works of literature and biography from 19th and 20th century America, I see references to cheap nightly rates (adjusted for inflation) at hotels and boarding houses. These stories often feature a low-wage worker who can afford a room at a nightly rate, often with meals included. I am not aware of hotels that would be as affordable in our time. What caused this change?
I'm a former hotel school faculty member so, here goes:
You are often reading about boarding/rooming houses, which were typically homes with many bedrooms. Guests leased rooms and prior to the 1930s may well have had to use outhouses or they all shared a single bathroom. Meals might be provided communally in a dining room, but there was no choice...you are what was given and quality wasn't always good. There were also "hotels" in which you could rent a bedroom (shared bathroom) but those would not be recognized as hotels by most modern Americans (though Europeans still accept similar structures). In all cases, rooms were small and had a simple, single mattress on a metal frame and perhaps a very small, simple desk, desk chair and lamp. There was often no elevator, so you traded off street noise for a long walk up when selecting a floor. In the cheaper places, the paint, wood floors, rugs if any, would be poorly kept. By the way, hot water and heat were not always guaranteed and air conditioning didn't exist.
At the time, there were beautiful, luxurious hotels (given the technology of the time), but they were expensive and only the wealthy came. Frequent travel by the middle.class is really a post WWII phenomenon.
Now, with modern health and safety codes, much of what did exist is no longer possible. If you want to offer a legal bed and breakfast, for instance, you must have a separate kitchen for the guests and for the owner in many places. This adds substantially to the cost structure along with fire suppression equipment, liability insurance (now people trip on rugs and sue), etc.
As well, as people became wealthier and lived in nicer places, they wanted hotels that were more similar to their homes. Rooms became larger, furniture more complex and plush and the decor is now refreshed every few years. There are also more public spaces, such as lobbies and computer nooks, that are costly and don't generate income. All of this raises costs and so price.
So, staying in a hotel now is a much safer and more comfortable experience than it was. Making it that way is expensive, however.