There are advantages and disadvantages.
Earth based telescopes have disadvantages because of the atmosphere, which blocks some light and it blocks some wavelengths almost completely and it also bends the incoming light. Some of the atmospheric displacement can be fixed with modern computers, so Earth based telescopes have improved significantly over the last 20-30 years, but they still have the disadvantage Earth's atmosphere blocking some of the light coming in from space. Today's Earth based telescopes are as good as Hubble (I read that somewhere) at least in the visible spectrum, in large part because of computerized imaging. When Hubble was launched (and fixed) at the time if was lightyears better than anything on Earth. Today it's close.
Chandra and Spitzer see in wavelengths that don't make it to Earth, so they need to be in orbit to work. James Webb will also view in the infra-red as well as visible wavelengths, so it needs to be in space to take advantage of it's infrared imaging.
Space is much better because it gets a much cleaner picture and it receives all wavelengths. There are disadvantages to being in space too, like cosmic rays, solar storms and the occasional near-light-speed proton but on average, space is better than Earth and the surface of the Moon is similar to being in space due to there being essentially no atmosphere.
A big problem with telescopes in space is that launching that much material is very expensive. It costs about $10,000 per pound to launch something into space. That's why there's so few you can count space telescopes on your fingers (fingers and toes actually, I think there's 13).
It's also important to keep large telescopes somewhat cold. (James Webb will have a large sun shield). That's especially important for infrared imaging. Provided the area is shaded, the moon will remain sufficiently cold.
The big advantage the Moon has is that it's full of silicon, which is what mirrors are made of, so by using lunar material, much less stuff needs to be launched and that saves a ton of money and increases the size of this theoretical telescope. That's the real advantage. We can't launch a 100 or 200 foot telescope from Earth because it's too big, but we could in theory, built one that size on the moon because there's lots and lots of stuff to use.
A smaller advantage is that the body of the moon acts as a shield for what's below it, but the real advantage is that the Moon is made of stuff that can be turned into a telescope. Really any large body a few miles in diameter would work, though working on a surface with gravity might be easier. Personally I think Ceres would be a great place to build. Very low gravity (but enough where you can set things down and not worry about them bouncing away) farther from the sun so a smaller sun-shield. Any reasonably large body in space could theoretically be used to build a telescope.
The moon, however, is closer, so it's both more easily repaired and it's close enough that it's easier to transmit images back to Earth as opposed to a Phobos based or Ceres based telescope.
This shouldn't be mistaken for easy though. It's never been done and might run into unanticipated problems and end up being quite difficult, but it's a nice idea.