Hundreds of thousands of people live in high density areas of Los Angeles with densities far exceeding San Francisco's most dense areas. Also people live in LA for the same reason they live in other big cities, because it's incredibly diverse and vibrant. Traffic may be bad, but most people aren't in transit for that long anyways since the city is still pretty dense, and you can get everything you need within your neighborhood (where many neighborhoods are totally walkable).