One of the important factors in regard to not considering tunnels as a first colonization step:
Our modern boring technology stack uses a great deal of water.
A liquid water.
This requires having the water in the first place and then pressurizing the environment in order to keep it liquid.
Recycling this water outside of the natural water cycle will be hard. A lot of this water could not be efficiently recycled because it is forever lost to the surrounding rock.
Another liquid substance could do as well, in some cases we use e.g. diesel fuel instead of water. But water is probably the nearest checkpoint anyway.
In short, before starting any tunnel-making one will need a lot of industrial infrastructure already up and running and a lot of various stockpile.
Another important factor:
No one starts boring, digging or mining big projects without knowing a lot about the expected geology.
On Earth, we have a lot of knowledge what to expect a meter, or 10m, or 100m underground, only looking at the surface. If we are in doubt, we drill for samples. And some projects still get in trouble or fail because we run over something unexpected down under. A rock too hard to bore, a rock too weak to bear the required load, etc, etc...
Moon and Mars are quite different and we don't even know the proper questions to ask ourselves before starting to dig.
And then, the tunnel casing.
It's not only the boring. We need a lot of steel and concrete to keep the tunnel from collapsing.
On Earth, these are by far the two cheapest materials (spare for the rock already lying around) used in construction. This is because we have giant factories producing steel and cement from readily-available natural resources.
Hint: both the iron ores and the coal (and the oxygen in the atmosphere as well) used to produce steel are artifacts of billions of years of life on Earth.
And don't even get me started on what the cement is made of.
On Moon or Mars, we may find it is cheaper to produce e.g. aluminum (by some yet to be invented modification of the basic electrolysis process, using solar energy) instead of steel and concrete.
All this sums up that failing to make use of some natural underground structure (lunar lava tubes, probably martian water-made caves) the best use of the expensive rocket-carried materials will be from the ground up and not down.