There is a wide consensus among international institutions and national governments in favor of compact (i.e. densely populated) cities as a way to improve the ecological performance of the transport system. Indeed, when both the intercity and intra-urban distributions of activities are given, a higher population density makes cities more environmentally friendly as the average commuting length is reduced. However, when we account for the possible relocation of activities within and between cities in response to a higher population density, the latter may cease to hold. Because changes in population density affect land rents and wages, firms and workers re-optimize and choose new locations. We show that this may reshape the urban system in a way that generates both a higher level of pollution and welfare losses. As cities become more compact, agglomeration occurs and, eventually, the secondary business centers vanish. By increasing the average commuting length, these changes in the size and structure of cities may be detrimental to both the ecological and welfare objectives even if intercity trade flows decrease. This means that compact is not always desirable, and thus an increasing-density policy should be supplemented with instruments that impact the intra- and inter-urban distributions of activities. We argue that a policy promoting the creation of secondary business centers can raise welfare and decrease emissions.