The electric trams were bad, because they were never actually intended as transport - the electric companies just wanted an excuse to hook the neighbourhoods up to electricity, and electric trams were just their excuse for doing so. It wasn't cohesively designed, they didn't necessarily think it was better than cars.
Note that saying they were bad is not the same as saying they had to be bad - they were just poorly executed because they didn't give a shit.
Everything is far apart because the streets are too wide. This dates back to the 1780s, it's actually older than cars, and it was what made people adopt cars in the first place - for instance, Manhattan already had its car-sized streets of their current size way, way before cars were invented.
In the long term, the problem is the street grid itself - squish everything closer together and everything will be nicer to walk to (because it's human-scale), closer to walk to in the first place, and cheaper to maintain.