You have heard both answers because both are right depending on the area and ecosystem.
Established trails: If there is an established trail going where you need to go, you should stay on it. Even to the point that in a mucky area stay in the tread, rather than create a new trail beside it which might be dry for a while, but will eventually become a new mess. This creates "braided trails" which can mar a whole open meadows are a pain to rehabilitate.* Never cut switch-backs.
Cross country: when striking out cross-country, you need to consider the surface and the impact it can handle. In alpine areas, if in doubt, spread out. Primarily we do this because it creates multiple faint trails instead of one impacted one, which can recover faster. Also, you would be surprised how many people see an obvious trail and say, "wonder where that goes" and follow it, compounding the problem. They are less likely to do this on a faint trail.
A major exception is in the desert where you might encounter cryptobiotic soil in which a single footprint can last dozens of years. If you can not find a way around the crypto (which is critical for preventing erosion) 1) re-consider why you need to go where you are going, or 2) make the fewest number of steps through it, and have everyone follow in the same footprints.
Sidebar: If you do find yourself wandering cross-country, please do not build a cairn to encourage others to follow. This funnels impact along a single route creating erosion issues where dozens of people could wander spread out without having that much impact. A large chunk of my time as a Wilderess Ranger was spent kicking down cairns on non-established trails. Let the next traveler figure out their own route.
*You could argue the trail should have been placed in a better drained area, but sometimes that is unavoidable.