Lower population density does not necessarily equate to higher carbon footprint, especially when commuting downtown for work has been eliminated. Above a certain point density has diseconomies of scale of its own.
For example, if you are comparing, say, a three bedroom house in a large metropolitan area versus a four bedroom house in a small town, the reduced total driving time because driving distances are less in the small town (everything is in town, but town is tiny) can make up for a lot of efficiencies of scale.
The common argument is that we should put people into apartments instead, but that isn't always a clear total system win. For example if somebody is really into fishing letting them live near a lake with space to store their own boat will be more carbon efficient than stuffing them into an apartment where every weekend they drive to the storage place on the outskirts of town to pick their boat up, then drive three hours or so to the lake.
However, cities are not for me. I work in my home office on the outskirts of a minor city. Right now I am listening to house finches and goldfinches arguing over places on the thistle feeders and smelling petrichor as rain showers move in.
Here is the important takeaway: I would never try to force you to live outside of a city. I hope you can grant me the same consideration and not force me to live in a city.
Secondly, those things you mention are true -- all else being equal. But everything else isn't equal. Eliminating thirty miles of driving a day can make up for a lot of extra heating costs. Houses can cheaply avoid major cooling costs like urban heat island effects, and lack of shade suffered by apartment buildings. Economies of scale in shipping is a thing, but past a tractor-trailer a day they diminish rapidly.
So it isn't as clear that, with the way people actually live in cities today, that the systematic carbon costs, or even financial costs, favours cities the way it might have fifty or eighty years ago.
This is wrong. As an extreme example consider this. If all families in the U.S. were as evenly distributed as possible with each family having at least a 1 acre lot then it would be correct to say that we are sprawled out. Sprawl in the sense we are taking about refers to spreading out.
Many people don't want to be in dense cities. Lack of open/green space, noise, crime, and the worst place to be during any sort of crisis.