Actually there is a lot to be gained by going to the moon. a stable construction site for one.
Any mars vessel is going to be dozens of big parts. Think not only ISS size, but three times that size.
You need a massive rocket to get to mars, and a second one to get back. The return rocket actually has to get there first too. You need extra fuel tanks, a mars base which has to be big enough to grow food in. You need a rocket to go from mars ground to orbit to dock with the return rocket etc.
Even if you were smart and combined a shuttle orbiter type vessel and just kept picking up extra boosters and fuel tanks, you still have to get those parts out there to begin with. Once built just putting the support equipment in place is a decade long job, before you launch people.
having a Moon base would help with construction, and more importantly storage. Even better is if the moon actually has water with which we can use as fuel. as lunar orbit is cheaper to reach than earth orbit by a significant margin.