To survive long-term without getting massively irradiated you need, at a minimum, metres of rock between you and the sun (and as you say, lifting them from Earth is going to be expensive). Ideally a magnetosphere too. Gravity is also desirable for health reasons and random practicality things (e.g. in zero-g you have to sleep in a draught, as otherwise there's a risk of a dangerous bubble of CO2 forming around your head). And temperature can be a huge problem for spacecraft that aren't attached to a big heat reservoir - scorching in the sun, freezing in the shade.
Maybe ultimately we'll be able to construct nice habitats for orbiting stations, but with current engineering capabilities rocky bodies are the only safe places to stay long-term. I certainly expect we'll get to asteroids eventually. But for now, Mars is closer than the asteroids, closer in delta-V terms than the Moon, and much more promising in terms of having organic-y raw materials available for farming and fuel. It makes sense to go there (or maybe Venus, but aerostats would be a big chunk of new engineering) first.
Maybe ultimately we'll be able to construct nice habitats for orbiting stations, but with current engineering capabilities rocky bodies are the only safe places to stay long-term. I certainly expect we'll get to asteroids eventually. But for now, Mars is closer than the asteroids, closer in delta-V terms than the Moon, and much more promising in terms of having organic-y raw materials available for farming and fuel. It makes sense to go there (or maybe Venus, but aerostats would be a big chunk of new engineering) first.