Boomtowns become ghost towns because the economic activity that supported it once, have failed. There's other reasons too like, human-caused disasters such as flooding, prolonged droughts, government actions, uncontrolled lawlessness, war, pollution, or nuclear disasters. Mining also causes people to leave when they can't produce anymore gold and silver. When the Gold Rush ended, the prospectors didn't provide business for towns anymore.
Hope I helped :)