True, but they weren't talking about the Bay Area. They were talking about San Francisco, and here the numbers are much different. The city of San Francisco has a population of about 852,000 in a land area of about 47 square miles. By contrast, the city of Barcelona has a population of 1.6 million in an area of just over 39 square miles.
That's 18,188 per square mile for San Francisco versus 41,100 per square mile for Barcelona -- less than half the density, as you'd expect. American cities are typically more sprawling, when compared to their more compact European rivals. (Other countries just can't afford the sprawl that America can. But then nor can America really, any more.)
"But they said both cities had the same population," you proclaim. Well, yes, but they were probably comparing the metro population (4.6 million for San Francisco; 5.4 million for Barcelona.) But the same holds true here -- the San Francisco metro area (San Francisco–Oakland–Hayward, CA Metropolitan Statistical Area) has a land area of 2,474 square miles, versus just 1,648 square miles for the metropolitana de Barcelona. So once again, San Francisco has roughly half the density.
But perhaps that's the problem. San Francisco has a low-enough density that drivers can get some speed up with which to kill pedestrians, whereas in Barcelona there are just so many people that you're used to constantly watching for them and sitting on the brakes, or you couldn't get through a day without hitting one.