Sure, the Moon offers different challenges in spots, but it'll still let us validate things like growing crops, water reclamation, robotic construction, etc. with the ability to pop home if it all goes disastrously.
I think a long term colony on either of these worlds would be much safer below the surface where it would be shielded from cosmic rays etc.
If we can learn to build 'ant colony' style habitats on the Moon, we ought to be able to do the same on Mars once the cost of travel becomes lower.
If you're concerned about civilization-ending climate/nuclear disasters, consider that even in that event, parts of the Earth will still be more hospitable for human life then the Moon or Mars.
Personally I would love to see both outcomes. But given a limited budget, going to Mars has the advantage of providing a (admittedly risky and uncertain) possibility of extending the survival of the human race, where as going back to the moon seems to provide more indirect benefits.