What should an election system for choosing the president attempt to achieve? Certainly one goal is to reflect the popular will, an outcome that might (or might not, depending on how the system is structured) be achieved with a direct popular vote.
But as the founding fathers recognized, reflection of the popular will is not the only goal.
Another goal is to provide candidates with incentives to broaden their geographic and political bases and to steer toward the center rather than the extremes of the political spectrum.
This, the founders felt, would help reduce the sources of political strife and, in the extreme case, avoid civil war. They understood that passions and irrationalities can afflict mass decision-making under direct democracy.
The electoral college system as we know it today furthers that goal. The winner of a plurality in any given state (with two minor exceptions, Maine and Nebraska) gets all of that state's electoral college votes; the candidate who wins a majority in the electoral college (270 out of 538) is elected president.
Yes, the electoral college distorts the popular vote results somewhat, usually by giving the winner of the popular vote an even greater percentage of the electoral college vote. On rare occasions, the winner of the popular vote fails to win a majority in the electoral college. This happened famously in 2000, and in 1888, 1876 and 1824. It almost happened in 1976, when a switch of about 5,500 votes in Ohio would have given Gerald Ford an electoral college majority and the presidency, leaving Jimmy Carter with a majority in the popular vote.
But in exchange for that distortion, the electoral college offers important benefits.
Once a candidate determines that he will be able to win a plurality in a state, thus getting all the electoral college votes, there is no point in campaigning further in that state. The candidate is then driven (by the pressure of the market, so to speak) to develop plurality support in additional states. Thus are candidates forced to broaden their geographic bases; those whose support is heavily regionalized are penalized implicitly.
This was particularly important in 2000: Al Gore piled up huge majorities on the West Coast and in the Northeast (hence his victory in the popular vote), but was not strong in the rest of the country (and so lost the electoral vote).
Because the plurality winner in a state gets all of that state's electoral votes, third and fourth parties have little hope of winning important numbers of electoral college votes (although they can deny a plurality to a candidate).
This means that the electoral college promotes the two-party system at the state level. The two-party system offers the important long-term benefit of forcing candidates and platforms toward the middle of the political spectrum, thus increasing consensus and compromise and reducing political strife.
A direct popular election under a plurality rule would tend to yield candidacies (and parties) with strong regional and ideological loyalties, with a goal of simply piling up more raw votes than anyone else. A runoff system would give disproportionate bargaining power to regional and ideological fringes. A system of allocating electoral college votes in proportion to the popular vote (now proposed for Colorado) would induce candidates to shift their efforts and resources to uncompetitive states, where there are large numbers of electoral college votes to be had.
Yes, the electoral college is easy to poke fun at. Yes, it occasionally frustrates the will of the plurality or majority. But the founding fathers understood the dangers of direct democracy and struggled to create a system that reflected the will of the people while constraining the majority. The electoral college serves those ends well.