The Moon is days of travel time, whereas Mars is months of travel time. Round-trip communication delay to the Moon is seconds. Delay to Mars is minutes. Pieces of the Moon can be returned as souvenirs. Delta-v for returning bits of Mars is ridiculous. People can SEE the Moon with the naked eye, even in urban light pollution. Mars requires a map of the sky and a pair of binoculars, at least.
The Moon is important because it motivates the nonscientific people of Earth to support more productive forms of space exploration research. It reminds people that this is not only a very small world, but the only one we have. And it creates a seed economy with a shorter possible cycle of iterations than a few missions clustered around the same 3-month launch window every 780 days. There is some merit to having regular shorter missions to a closer target, so that when that window comes around, you have people with steady jobs and experience around to run the longer missions.
It isn't just about the scientific benefit. You also have to consider the human factors. Nobody wants to train for years to be unemployed 90% of the time, waiting around for the next time someone needs some specific skill. The thing about Moon missions is that they can be done with resources that would otherwise be mothballed and rusting, or used once and discarded.