The westward rush of the railroads across the Plains and westward led to an onward march of an interesting social characteristic that gained a special name: "hell on wheels." More than just a curse or profane expression, "hell on wheels" was a Westernism for a very specific advancement of a very unusual type of a sort of "portable town."
The expression "hell on wheels" referred to the motley collection of tents, board shacks, furniture, furnishings, and people who were moved along by the railroad itself ahead of the advancing rail-head and set up near the tracks for the benefit of the railroad workers. This ragged collection of shanties and shady people usually centered around a large tent and included a group of smaller tents and shacks that housed all the gamblers, prostitutes, and fast-money merchants who met the needs of the rail workers and others involved in moving the tracks westward.
As a particular rail line advanced its tracks, this bevy of ragtag people and "services" moved right along with them. One very useful book for those interested in the 19th Century, "Everyday Life in the 1800s," quotes a source from 1867 which described "hell on wheels" this way:
"... these settlements were of the most perishable materials -- canvas tents, plain board shanties, and turf-hovels -- pulled down and sent forward for a new career, or deserted as worthless, at every grand movement of the Railroad company .... Restaurant and saloon keepers, gamblers, desperados of every grade, the vilest of men and women made up this Hell on Wheels, as it was most aptly termed."
According to Winfred Blevins' "Dictionary of the American West," such slapped-together, portable "towns" may have slept as many as 3,000 traveling residents. Blevins also says these odd places were sometimes referred to in Western accounts and literature as "end-of-line towns," "hurrah places," and "towns with the hair on."
No matter what they were called, these quickly portable, temporary towns were rough and rowdy places, and certainly not for the weak hearted or easily offended visitors. We can assume they were allowed to flourish and kept moving courtesy of the railroads for very practical reasons. If the men needed on the job to keep the tracks moving wanted to gamble or wanted the services of a prostitute -- certainly they shouldn't be allowed to venture away from the tracks too far. In many cases there were no nearby towns, and when there were, most likely the townsfolk would not be pleased to be overrun by the railroad workers. And, of course, if the railroad workers were drawn too far away for their drinks, gambling, and other "socializing," they might not return to keep the railroad moving.
And the motto of the Eastern railroad big-money men was always that the railroad must go on!
(Not surprisingly, according to Blevins the term "hell on wheels" also came to be used to characterize an unbroken horse given to wild bucking.)