Human beings have to live somewhere and gathering them together in a small urban footprint is better for the climate, not worse.
There isn't a magic answer to it, but simply saying dense areas use less footprint for shelter ignores all the other necessities and conveniences consumed by the people living there.
Single family homes are often easier to power off-grid with solar if that's on the table, though again with regards to externalities the solar power equipment likely sends those costs to multiple countries on the other side of the planet.