The campaign comes as San Francisco, one of the most expensive cities in the United States, wrestles with a nearly intractable problem of homelessness that has filled shelters to overflowing and left a meager amount of publicly subsidized housing available to the poor and mentally ill.