There are two "Wild Wests" we need to think about - one of reality and one of the imagination. The one of reality is a product of the expanse of the North American continent and the reality of European settlement patterns that started on the Atlantic coast and proceeded west. So the "West" of the eighteenth century was wild in its own right - dangerous, unsettled and sparsely populated (from the European point of view) and as a result we have novels - the imagination part - The Last of the Mohicans, for example, that gave the urban East an image of a Wild West. The wild, frontier part of the West had plenty of room to perpetuate itself as the "unsettled and sparsely populated" region was continually replaced by the next "wild" territory to the West.
That's all simplified because it is a large region. Keep in mind that the Far West - the Pacific Coast - became settled and began "moving east" just as the Eastern settlements were spreading into the western frontier.
There was a certain wild part of the West by nature of its being filled with more dangerous animals than "settlers" (all this is to discount the existence of many Native American tribes - but we're talking about perception not reality and these people added to the perception of "wildness" in their own right). The West is still filled with great expanses of unsettled wilderness, and survival there can be a challenge.
Then there is also the issue of lawlessness - a product of limited populations and even less government control. In fact, government - and population - usually arrived fairly quickly. But because the West is so large - again - there was always the next territory over that was lawless to perpetuate the idea that the "Wild West" was always out there somewhere.
All of this made the region's colorful frontier history an ideal subject for novelists and film makers who wanted to capture that magical period and place where people were tested against the extremes of nature and the circumstance of limited government and law enforcement. It captured the imagination of the nation for well over a hundred years - and it still does.
This is not unlike, by the way, the way medieval Icelanders viewed their own "frontier" period of initial settlement when establishing law and order was a challenge and "sword slingers" (they didn't have gunslingers!) commanded respect and could cause a lot of trouble. It is easy to romanticize about this sort of period. In the case of the Wild West, a lot of the romantic imagery is exaggerated or false (or at least it was short lived in any given place), but that does not make it less engaging for novelists and film makers.