It depends. I won't completely avoid a city if the most straightforward way is to go through it. On the other hand, I also don't expressly seek them out. It is sometimes useful to also spend some down time in a really long trip.
Examples of some of the largest cities > 1m people on my trip across the Americas (the metro areas may have more than what is listed here as city populations):
Mexico City - population 9m+, avoided going directly through it, since there was a reasonable ring route
Lima - 9m+, went straight through it, it was pretty hectic but worked.
Quito - 2.5m, went through and stayed in the city
Medellin - 2.4m, went through and stayed one night
Cali - 2.3m, bypassed since reasonable alternate route
San Diego - 1.4m, went through and stayed
Guadalajara - 1.3m, went through and stayed in it, slightly hectic crossing
Tijuana - 1.3m, bypassed rather than go through it
Tegucigalpa - 1.1m, went through it
Guatemala City - 1m, went through it
Los Angeles, Santiago, Bogota, Buenos Aires, Cordoba - no reason to go out of my route to visit - so I didn't.