The distance between moon and earth is just 384,400 km. So, if we can travel (from moon) to another planet, we also can travel (from earth) to the same planet. But I've read that some scientists want a moon base although we can have an earth base. Why? What are the advantages of a moon base.
The reason many scientists want to create a Moon base isn't because of distances in space, it's because of gravity wells. The amount of energy to escape the gravity well of a body in space depends on the mass of said body. For example, the amount of energy required to take off from Earth and go to low Earth orbit is MUCH higher than the amount of energy it takes to take off from the moon and reach low Earth orbit. The Moon has a much lower mass and therefore a much lower gravity well.
The practical XKCD 681 gives a very intuitive example of the amount of energy it takes to get out of a planet (or moon's!) gravity well.
The amount of fuel a rocket needs to "escape" the planet is shown by the depth of the well in this chart. On the bottom right you can see that the gravity well of earth is much deeper than that of the Moon.
Another easy example is in fuel costs. This image shows fuel costs of the Apollo Moon missions:
Don't be fooled by the broken bar for launch. If you were to actually draw this chart to scale, it would be impossible to read as launch fuel costs were around 96% of fuel costs for the entire mission. This means that the Apollo mission used 96% of it's fuel taking off and getting into low Earth orbit. With the remaining 4% of fuel the astronauts went to the Moon, entered orbit, landed, took off, and flew back to earth.
In short, having a Moon base which produces fuel from resources available on the Moon (water ice probably) would mean that you could save enormous amounts of fuel on all missions in space. Instead of having to launch all the fuel you will need on a Mission from Earth (where the launch is very expensive), you could simply refuel at the Moon.
In fact, if asteroid mining ever becomes a reality, it will likely be cheaper to import metal from asteroids for use in earth orbit than to send the metal up from Earth because although asteroids are much further away, the energy requirement to move there and back is far lower than a launch from the surface of Earth to space, or as the old maxim goes: "Once you've reached orbit, you're halfway to anywhere"
The lower gravity and lack of atmosphere appear well suited to launching rockets. The assumption is that available resources that would not have to be brought from Earth will be obtainable on The Moon at lower cost. However the infrastructure required for making effective use of Lunar resources at the level of sophistication needed for a major space launch facility - and the distance to major centres of high tech industry to support it - means doing so is likely to remain prohibitively expensive for the foreseeable future.
A lot of hypothetical preliminary steps need to be achieved successfully for The Moon to be demonstrably better or cheaper than other options for a space launch facilities - ie better than ongoing direct launches from Earth or from orbital facilities.
One reason could be the weather is better on the Moon.
Rocket launches from Earth are complicated by weather, which could lead to launch postponements. Meanwhile celestial mechanics marches on, oblivious to the puny clouds on a portion of one small planet, so launch windows are limited. Going to the Moon is less weather-sensitive because the Moon is bound to Earth. Then, there are fewer weather issues for the subsequent interplanetary launch from the Moon.