SAUSALITO, Calif.—Homelessness has become such a big problem in the San Francisco area that waters outside the city are increasingly crowded with people living on makeshift boats.

The homeless population floating off the coast of wealthy Marin County, just north of San Francisco, has doubled in recent years to about 100, according to authorities. The ragtag collection of some 200 barges, sailboats, and other mostly decrepit vessels in which they live and store their belongings is a sign of an affordable-housing crisis in California...