When Congress was formed, it was separated into two distinct legislative assemblies; a House of Representatives to directly represent the general population and a Senate to directly represent the State Legislatures.
However, due to partisan bickering and electoral deadlocks that left states under-represented or completely without representation in the Senate, an amendment was proposed and ratified to change the Senate’s electorate so that Senators would be elected by popular vote instead of being selected by the Legislatures.
On the up-side, this amendment did solve the problem of Senate seats sitting vacant for extended periods of time but, on the down-side, Senators became less responsive to their State Legislatures and more responsive to their political parties, lobbyists, and large campaign donors. And who can blame them? If Senators are not chosen by their State Legislatures then they must participate in high dollar political campaigns to get elected which, in turn, makes the opinions of their State Legislatures completely irrelevant to their overall political aspirations.
In short, the 17th Amendment to the United States Constitution keeps the Senate populated with Senators that are unaccountable to the State Legislatures that the Senate, itself, was created to serve.