The men who wrote the U.S. Constitution feared (small “d”) democracy, which they often associated with mob rule. The Electoral College was the awkward device imposed between voters and the power of the presidency — just in case the hoi polloi got carried away.
We have developed a friendlier attitude toward the popular vote in the centuries since, though it isn’t complete. Legislation to encourage a push toward the direct election of the president, introduced by Republicans, died a quiet death this year — at the hands of the most conservative elements in the state Capitol.
As to the point in the last sentence, I've talked about the sheer spam-scam nonsense of the (falsely named) 'National Popular Vote' movement before, about which I will only say here: good riddance and may its rotting corpse no longer lurch like a zombie out of its grave in search of idiot minds to devour. But over and over again, one hears this falsehood about the Founding Fathers creating the Electoral College to limit the power of the people. Indeed, this makes no sense historically. The system that the Electoral College replaced only allowed the people power over offices through their legislatures; the Electoral College gave them a new power that they didn't have before. The Electoral College was deliberately introduced for the purpose of guaranteeing that the people themselves would be brought into the election process for the Presidency, which was, in the form given in the proposed Constitution, a new and extraordinarily powerful office.
If you look at Hamilton, for instance, this is quite explicit, since Hamilton's defense of the Electoral College repeatedly connects it to guaranteeing a popular safeguard in the election of the President:
It was desirable that the sense of the people should operate in the choice of the person to whom so important a trust was to be confided. This end will be answered by committing the right of making it, not to any preestablished body, but to men chosen by the people for the special purpose, and at the particular conjuncture....
...Another and no less important desideratum was, that the Executive should be independent for his continuance in office on all but the people themselves. He might otherwise be tempted to sacrifice his duty to his complaisance for those whose favor was necessary to the duration of his official consequence. This advantage will also be secured, by making his re-election to depend on a special body of representatives, deputed by the society for the single purpose of making the important choice.
To be sure, this sense of the people was not the only concern that had to be addressed by the constitutional system for electing the President; this is because the Presidency as it existed in the U.S. Constitution was the single most controversial part of the entire proposal -- a great many people thought that there was too much power concentrated by the Constitution into one office, so those defending the Constitution, like Hamilton, Madison, and Jay, had to allay worries about the possible tending of this "energetic magistrate" toward tyranny. So, for instance, Hamilton thinks that the Electoral College will provide a space for deliberative investigation of "all the reasons and inducements" for making a choice for the office. (The absurdity of electing the Electors so that they can rubber-stamp an already decided result is completely foreign to how Hamilton expected the Electoral College to work.) The means of election needed to be orderly and to allow for diversity in the election -- the Electoral College was intended to avoid a free-for-all every four years. (And here, at least, it works more or less as it was intended -- it makes it easier for people to keep track of the election given the huge population, and by breaking the election into chunks it makes more clear that everyone has to take into account more than just the view that happens at the moment to have the majority.) It needs relative immunity from corruption, as well -- which, people forget, is difficult to guarantee in a straight popular vote.
Thus there were other things that were thought important to consider. But the Electoral College was not put forward to reduce the power of hoi polloi but to increase it by guaranteeing them a say in the single most powerful federal office, which they did not have before, and as a way of guaranteeing that they would be one of the checks on the massively increased power that would be wielded by the President under the proposed Constitution. To be sure, one can find complaints about the Electoral College as an intermediary even in the anti-Federalist movement (Antifederalist no. 72, for instance); but the real target then was the sheer power of the Presidency in the new system. The Electoral College itself was designed to link the President to the people in a system already organized according to states, not to serve as a limit on the power of the people.
Of course, there is a legitimate question as to whether the Electoral College in practice lives up to the promise of the Electoral College in its original intent. But there's no question that the Electoral College as it was originally conceived involved a considerable expansion of the power of the people over the government.