Unless you are talking about millions of people, in which case it is possible that Mars might have some advantages, then the Moon. It has plenty of water (we believe) at its poles. The main question to be determined is how easy it is to extract. But it may well be easy. It’s got less gravity which makes it easier to take off again - aerobraking helps with landing but not with take off. It has advantages for landing too as we can do pinpoint landings, while on Mars landings have to have a “landing ellipse” because of the unpredictability of aerobraking meaning you have to have an ellipse kilometers in dimensions that is completely flat, ideally with no boulders or cliffs, to land safely. You can also abort easily back to orbit for the Moon if you spot a problem during the landing, the lunar module could easily carry enough fuel to get back to orbit. A rocket landing on Mars has to refuel before it can take off again.
It has sunlight 24/7 at the poles for most of the year bar a day or two when hidden behind a mountain, and near constant temperature there, and double the amount of sunlight of Mars. Mars has global dust storms that can block out the sun for weeks on end.
The dust on Mars is an unknown, but has perchlorates and probably the more hazardous chlorates and chlorites too. The lunar dust we know can be breathed for a few days without much by way of adverse effects - but what’s more, we can also just turn it to glass, and if you make the region immediately around a base consisting of glass then there is no way that dust can blow in. It would take some precautions as for Mars but just going outside e.g. to repair your base, work with equipment that has to be outside etc would not mean you take in dust whenever you come back in..
We have no idea what level of gravity humans need for health so you can’t say that is an advantage of Mars, at least not at present. It might also depend on the person, age, sex etc. For all we know, lunar gravity could be better for health than full g. We just don’t know yet. Or we might need artificial gravity to stay healthy on both the Moon and Mars.
It has a high vacuum which is an asset for industry - you can make solar panels “in situ” by vacuum deposition in a hard vacuum harder than in any solar cell manufacturing planet on Earth. What’s more, there is nanophase iron throughout the lunar soil and dust so you can convert it to glass quickly with a microwave. There are no dust storms on the Moon, while on Mars they block out the sun for weeks on end.
The Martian carbon dioxide is not an advantage for growing plants. There is CO2 at the lunar poles anyway. But when you are in a space habitat, then CO2 is a problem gas to be removed, not an asset like oxygen. And if you grow your own plants, you produce exactly as much CO2 as the plants need to grow, by breathing. Our atmosphere has only trace amounts of CO2 and that’s all that plants need to grow as they are very efficient at scavenging CO2 out of the atmosphere. Just a few kilograms of CO2 in the ISS atmosphere for instance. If you have to import more food than you grow, then the carbon dioxide will build up. So - even if you have large greenhouses full of plants, you only need a few kilograms of carbon dioxide to get them started, and the people who eat the plants plus decaying wastes or burning waste organics provides all the CO2 they need.
The Moon has many useful metals for construction and industry. The one thing we are unsure about are the Platinum group metals but it has been hit by many iron meteorites and there is evidence that suggests that it may have platinum too.
The lunar lava tube caves, in its light gravity, can potentially be much larger than on Mars. They could be kilometers in diameter and we have evidence from orbit that they are over 100 kilometers long. As large inside as an O’Neil colony - and they would be places that have stable temperatures too, so a natural place to expand into.
Now, I don’t think that either is a good place to colonize right now. Nor making habitats using materials in the asteroid belt. If we ever have the technology that makes it possible to colonize Mars or the Moon then we can also set up those habitats in any desert on Earth and “colonize” those far far more easily. Breathable air apart from anything. Easy access to water just from the air never mind the sea. If you are in a desert and there is sea nearby, and a breathable atmosphere, you have resources beyond the wildest dreams of a “Mars or Moon colonist”. That would be an absolute paradise for them.
So I don’t see us colonizing any of these places for their own sake. Rather has to be some other reason to be there. And the Moon is the most likely place to provide such a reason because it is so close to Earth and also so little gravity.
Mars could provide such a reason too, for scientific study, search for present day life or past life. But that’s done best from orbit rather than on the surface in order to protect it from Earth life. For more about the reasons see my OK to Touch Mars? Europa? Enceladus? Or a Tale of Missteps?
Which leads to the idea also of settling the Martian moons, Deimos and Phobos. I think we need to study them carefully and consider what the impact would be of doing this. But they are as accessible as the Moon in terms of the delta v to get to there and back, though further away, and Deimos may well have lots of water ice though we don’t yet know that for sure. And there would be a reason to be there, to study Mars. But Deimos and Phobos are also interesting in their own right and how much impact would a human base have on such tiny worlds?
The Moon is the obvious place to start our experiments in sending humans to somewhere else other than Earth. Lots of space to try out, huge surface area larger than Africa, our “eighth continent” as it’s been called.
See also my Case For Moon First
MOON FIRST Why Humans on Mars Right Now are Bad for Science.