olivaw_daneel
If we are talking about taking advantage of resources not available on Earth, the untold riches of the Asteroid Belt are eminently more accessible from Mars.
The cost of shipping factories (and many raw materials) in pieces from the Earth to the Moon and then assembling them there should certainly outweigh just building and launching from Earth, especially as private companies perfect reusable rockets.
I do not see the challenges of building a habitat on the moon that much different from Mars. You have (essentially) zero atmosphere, lots of radiation, the same problems with building a pressure dome, etc.
Beyond just the gravity difference and the scarcity of any resources for in-situ utilization on the Moon, temperatures will vary from <-100 degrees at night to > 100 degrees (celcius) during the day. This is a vastly different regime than Mars, which has a much more temperate day-night gradient.
Landing men on Mars is certainly romantic, but it will be so expensive and time consuming that it cannot have much practical value.
It will be both expensive and time-consuming, but just imagine the science a few geologists could do on Mars, and what they will reveal about not just the red planet but also about our own.
It's really a zero-sum game, unfortunately.
The scientific/engineering (and cultural/sociological) gains from a human return to the moon would be tiny compared to a Mars mission, and any funding (think tens of billions) allocated to such a mission will necessarily push a Mars mission back by a decade or more.
First, the science -- while the robotic mission to Mars have yielded many insights about the early history and present state of the planet, a human geologist could do more in a day or two than all of the rovers have done thus far. A small group of human scientists could completely rewrite the textbooks in a short stay on Mars. Can the same be said about a moon mission?
Second, living on the moon would be much more difficult (temperatures, micrometeorites, lack of ISRU, etc. etc.), and involve very different challenges than living on Mars. Most of what we learn on the moon will simply not translate to Mars--it will certainly not be a lot easier to live on Mars once a moon base is established, we would nearly be starting from scratch.
This is a perennial debate in the human spaceflight program, and I understand the desire to do something given decades of inaction. However, we must be honest about what we stand to lose if we shift our focus to a return to the moon. There is precious little gain from both a science and engineering perspective.