The U.S. military offloaded thousands of gay servicemen in San Francisco during World War II after they were discharged for being gay. Many settled in the Castro, and thus began the influx of gays to the Castro neighborhood.[citation needed]
The Castro came of age as a gay center following the Summer of Love in the neighboring Haight-Ashbury district in 1967. The gathering brought tens of thousands of middle-class youth from all over the United States. The neighborhood, previously known as Eureka Valley, became known as the Castro, after the landmark theatre by that name near the corner of Castro and Market Streets. Many San Francisco gays also moved there after about 1970 from what had been the formerly most prominent gay neighborhood, Polk Gulch, because large Victorian houses were available at low rents or available for purchase for low down payments when their former middle-class owners had fled to the suburbs.

Harvey Milk, here with his sister-in-law in front of Castro Camera in 1973, had been changed by his experience with the counterculture of the 1960s. His store was used as his campaign headquarters and remains a tourist destination to date.
By 1973, Harvey Milk, who would become the most famous resident of the neighborhood, opened a camera store, Castro Camera, and began political involvement as a gay activist, further contributing to the notion of the Castro as a gay destination. Some of the culture of the late 1970s included what was termed the "Castro clone", a mode of dress and personal grooming -- tight denim jeans, black or desert sand colored combat boots, tight T-shirt or, often, an Izod crocodile shirt, possibly a red plaid flannel outer shirt, and usually sporting a mustache or full beard—in vogue with the gay male population at the time, and which gave rise to the nickname "Clone Canyon" for the stretch of Castro Street between 18th and Market Streets. There were numerous famous watering holes in the area contributing to the nightlife, including the Corner Grocery Bar, Toad Hall, the Pendulum, the Midnight Sun, Twin Peaks, and the Elephant Walk. A typical daytime street scene of the period is perhaps best illustrated by mentioning the male belly dancers who could be found holding forth in good weather at the corner of 18th and Castro on "Hibernia Beach," in front of the financial institution from which it drew its name. Then at night, after the bars closed at 2 AM, the men remaining at that hour often would line up along the sidewalk of 18th Street to indicate that they were still available to go home with someone (aka The Meat Rack).
The area was hit hard by the AIDS/HIV crisis of the 1980s. Beginning in 1984, city officials began a crackdown on bathhouses and launched initiatives that aimed to prevent the spread of AIDS. Kiosks lining Market Street and Castro Street now have posters promoting safe sex and testing right alongside those advertising online dating services.
deets here