Direct election was a proposal at the time, and many founding fathers supported it, but the slave states shot it down.
The slave states are often mis-characterized as rural/not populous as compared to northern states. But that logic only holds if the color of your skin defines your humanity -- slave states weren't significantly less populous, it's just that a huge portion of their populations weren't enfranchised. In fact, the most populous state was a slave state. So IMO the thesis that the electoral college is a result of slavery is mostly accurate.
As far as the "official" reasons (since slavery was a touchy motivation, even back in the day), see https://en.wikipedia.org/wiki/Federalist_No._68 which outlines the "official" reasons for having a college as well as all of the alternatives at the time. Most of these seem pretty irrelevant to the modern world:
* As a veto on dangerous men -- I don't see this ever happening in our modern world.
* To avoid "cabal, intrigue, and corruption" as well as pandering. None of these function as arguments against a direct vote, but rather as arguments against the use of governors, congress, etc. in place of the electoral college.
There's an explanation on wikipedia [1]. In the light of the current election, the following sentence from that article sounds ironic to me:
'Hamilton was also concerned about somebody unqualified, but with a talent for "low intrigue, and the little arts of popularity," attaining high office.'