All states but Nevada have outlawed prositution and brothels however both played major roles in the development of many Western States in the US. The owners contributed greatly to many causes such as education while being seen as valued members of society so what changed and why did prositution and brothels virtually disappear? Why did Nevada keep it legal while surrounding states made it illegal? What factors contributed to it's demise?
This is a complex issue. Nineteenth-century western communities typically regulated prostitution, restricting its location and the nature of its operation. Generalizations are problematic, but it's fair to say that people in the nineteenth-century West often concluded that prostitution was inevitable, so local governments could and should at least limit where and how the business manifested.
Beginning with the turnoff the twentieth century, the Progressives began to consider a range of social ills that its adherents believed should be addressed and could be "cured" with appropriate legislation and government action. That movement gave the nation the prohibition against drinking alcohol, for example. Most Western states followed that fashion and began prohibiting prostitution - although it was by no means universal at the time.
The state of Nevada began passing legislation that would restrict prostitution even more, prohibiting it in the state capital and in counties of a certain size. The authority to license prostitution - or not - was left to the counties. After WWII, there were 17 counties in the state, of which three were prevented from considering licensing because of size (this included the counties serving Las Vegas and Reno) and the capital, so only fourteen counties had the option of having legal prostitution. Of these, two have not taken the step of allowing legal prostitution. The twelve that remain are remote, rural counties that tend to have sparse population, enormous amounts of federal land, and few means to raise revenue for governance. Legalized prostitution has provided needed revenue for these local governments to function. Philosophically, allowing prostitutes to conduct their business is consistent with the perception that the Progressives were unrealistic in their goals and solutions (Prohibition didn't work out well, for example) and a strong strain of Libertarianism inspires many to see the regulation of sexual commerce as none of government's business (not to mention how many of these people see the "nanny state" as a bad idea). Many liberals are torn by the well-attested fact that prostitutes in legal brothels are safer and more disease-free than on the street. Nevadans are fond of pointing out that every state has prostitution; laws don't eliminate the practice, so at least rural Nevada offers a safe sanctuary for the women - and men - involved.