There are a variety of reasons for building and operating space stations, including research, industry, exploration and even tourism. The first space stations were built to study the long-term effects of weightlessness on the human body. After all, if astronauts will ever venture to Mars or other planets, then we must know how prolonged microgravity on the order of months to years will affect their health.
Space stations are a place to do cutting edge scientific research in an environment that cannot be matched on Earth. For example, gravity alters the way that atoms come together to form crystals. In microgravity, near-perfect crystals can be formed. Such crystals can yield better semi-conductors for faster computers or for more efficient drugs to combat diseases. Another effect of gravity is that it causes convection currents to form in flames, which leads to unsteady flames. This makes the study of combustion very difficult. However, in microgravity, simple, steady, slow-moving flames result; these types of flames make it easier to study the combustion process. The resulting information could yield a better understanding of the combustion process, and lead to better designs of furnaces or the reduction of air pollution by making combustion more efficient.
From high above the Earth, space stations offer unique views to study the Earth's weather, landforms, vegetation, oceans and atmosphere. In addition, because space stations are above the Earth's atmosphere, they can be used as manned observatories where space telescopes can look out upon the heavens. The Earth's atmosphere doesn't interfere in the views of space station telescopes. In fact, we've already seen the advantages of unmanned space telescopes like the Hubble space telescope.
Space stations might be used for space hotels. Here, private companies like Virgin Galactic could ferry tourists from Earth to space hotels for brief visits or extended stays. To this end, Galactic Suite, a private company based in Barcelona Spain and lead by space engineer Xavier Calramunt, claims to be on track for having a space hotel in orbit by 2012. Even grander extensions of tourism are that space stations could become space ports for expeditions to the planets and stars or even new cities and colonies that could relieve an overpopulated planet.
Now that you know why we might need them, let's "visit" some space stations. We will start with the Russian Salyut program -- the first space station.