They were elected by the entire legislative body of the State (as I recall).
Since the Civil War, American government has slowly moved away from such "indirect" elections of leaders and moved closer to full, direct democracy. In my opinion, such a system of government is incompatible with a constitutional republic such as the one our founding fathers created. Successful "leaders" have come to be defined as the ones who do the best job of pandering to the tastes of an electorate that is increasingly ignorant and vulgar.
Without the 17th Amendment, people like Al Gore, Joe Lieberman, and Trent Lott would never have been elected to the U.S. Senate.