The history of certain pockets of real estate in San Francisco is fascinating, and young historian Griffin Estes has pulled together a pretty thorough timeline of tidbits for Hoodline about how Alamo Square Park came to be. Among the things that began to get the neighborhood attention was a rail line brought up through Hayes Valley by that 'hood's namesake himself, Colonel Thomas Hayes, in order to bring people out of the center of the city to what was then a suburban respite. Hayes' streetcar took people east from Market Street all the way to Lowell High School (now a CCSF extension campus), on Masonic between Grove and Hayes, and led to some of the early speculation about Alamo Square the property around it.
Estes quotes local journalist Edward Morphy, writing about the area in retrospect in 1918, describing the Alamo Square of the late 1800s as "a primeval forest of rocks at the top of hill," which had been designated as a future park by the city in 1868 but still had to be defended by a "succession of city attorneys" against various men who tried to claim parts of it for themselves.
The park as we know it today was graded and built between 1892 and 1896, right as land around the park was snapped up by well off businessmen and doctors. The famed Painted Ladies, facing the park on Steiner Street, were built during those same years by developer Matthew Kavanaugh, who lived in a mansion next door at 722 Steiner. They're featured in the famed photo below, taken from the park during the 1906 conflagration that followed the Great Earthquake, during which time Alamo Square Park became one of many encampments for the newly homeless.
Anyhow, it's a good read! And somehow comforting to be reminded that this town has always been full of eager developers and land-grabbers, and battles over parks.