Yeah. Mars is important, but testing stuff out where the ride home is a couple days instead of months/years seems a lot more sensible.
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.
There's another planet with a huge amount of unused sub-surface, and on-surface living space - the Earth. We don't even need to leave the gravity well!
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.
Robert Zubrin has discussed the "moon first" strategy, and has made the interesting observation that many of the pro arguments come from entrenched space industries looking to make a buck on existing hardware. The argument being "we already build parts to go to the moon, so let's just do that."
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.
Given a limited budget, lifting everything from earth, other than for a quick stunt mission to mars, is not economical. Nearly all the mass and elements needed - everything but hydrogen - is on the moon already. And hydrogen (water) may just be available too, at the poles.