Surely it wasn't made to be the just entertainment capital it is now? Why would anyone build a city right in the desert like that?
Las Vegas was originally a stop along what was likely a pre-contact trail, eventually known as the Spanish Trail: the springs at Las Vegas provided essential water in an otherwise dangerously arid environment. Beginning in the 1850s, Mormons and then others began to settle in limited numbers in the area - again because of the water.
The Las Vegas plat map was filed in 1905 by the railroad as a stop from Los Angels to Salt Lake City (and a connection with the transcontinental railroad). This created the town of Las Vegas, exploiting the water and the pivotal role the community played as a transportation hub.
In 1909, Las Vegas became the county seat of the newly created Clark County, splitting Lincoln County in half: Lincoln County was one of the largest counties in the nation, and the establishment of a population center in its southern half made the governance of Lincoln County difficult, hence the split.
In 1931, the state of Nevada experimented with legislation to confront the effects of the Great Depression. Quick divorces and marriages and legalized gambling were two important ways to attract tourism. This had an effect on the north more than Las Vegas, but an important foundation was put in place. As Hoover Dam was being built in the early 1930s, workers often went to Las Vegas for entertainment. The attractiveness of Las Vegas was enhanced with the completion of the dam, providing the region with water and cheap electricity, and with the invention of cost-effective air-conditioning. The proximity of Las Vegas to Los Angeles and the prospect of air-conditioned casinos made Las Vegas increasingly famous as a tourism destination, beginning in the post WWII nation.
As a sidenote, it is appropriate to point out that the internationally famous Las Vegas Strip is actually outside Las Vegas - to its south on county (but not city) land. By establishing casinos outside Las Vegas on the road that leads from Los Angeles, property owners were able to avoid city regulations and fees.