Because the framers of the constitution did not anticipate the rise of political parties, they provided that each member of the Electoral College could cast two votes for president, and that the person with the highest number of votes would be the new president, and the person with the second highest number of votes would be the new vice president. The reasoning behind this rule was that it would maximize the possibility that a person with a majority of national support would be elected president. (When people vote by the party and not by the person, the possibility of getting a majority is much greater, as electors never even consider voting for people that the major parties have not thrown their support behind.) It was thus that in 1800 the incumbent president was John Adams, a Federalist, and the incumbent Vice President, Thomas Jefferson was his rival, a Democratic-Republican.
In preparation for the election, each of the two major parties had a plan and a "ticket". Despite the fact that the constitution expected each candidate to run on his own and for the second runner up to be vice president, that is not at all how the major players in the election of 1800 organized themselves. Each party had a presidential candidate and a chosen running mate.
John Adams chose Charles Cotes Pinckney of South Carolina as his running mate. (He could not have chosen Alexander Hamilton, because Hamilton was foreign born, and thus ineligible to hold the office of president .) Thomas Jefferson chose Aaron Burr, of New York, as his running mate. Notice that they tried to keep things even between the North and the South: the presidential candidate from the North, Adams, chose a southerner for his running mate. The presidential candidate from the South, Thomas Jefferson, chose a northerner for his running mate. But make no mistake about it: despite the provisions in the constitution, there was a presidential ticket for each party that included a presidential and a vice presidential candidate. And in order to make sure that the right guy wound up president from their own slate, each party instructed one of their electors to vote against the vice presidential candidate of their choice, lest he get the exact same numbers as the presidential candidate.
But in 1800 something went wrong. Things did not go as planned at party headquarters. The person on the Democratic-Republican side who had been instructed to vote against Aaron Burr forgot or changed his mind, and Jefferson and Burr tied for president, each with 73 electoral votes. In the Federalist party, Hamilton and Adams were not acting in unison, which may be one of the reasons why the Federalists lost their hold on the presidency.
The issues in the election centered on the Federalist support of England against France, which resulted in the use of the Neutrality Act to prevent American privateers from serving the French interests, while the American government was engaged in a Quasi-War with France. And to make sure that people did not complain about this, the Federalists had passed the Alien and Sedition Acts. All of these were highly unpopular measures, which is why the Democratic-Republicans were the clear winners. But while everybody was tired of the tyranny of the Adams administration, and most Americans did not want to be satellites of England, there was also concern that Thomas Jefferson might be a Jacobin, and that his presidency might result in a loss of property rights as was suffered by the bourgeoisie under the French Revolution. That is why certain people, some of them Federalists, were campaigning behind closed doors to make Aaron Burr the president, and Thomas Jefferson the Vice President.
However, that was not Aaron Burr's doing, and he was an honorable man. He had promised to run with Jefferson as the vice presidential candidate, and though he had a chance to grab the presidency, he did not. He instructed his supporters in the House of Representatives to throw in their votes for Thomas Jefferson in the follow-up election of 1801. At this point, the Federalist supporters of Adams had been voting for Burr, while the faction of the Federalists that Hamilton controlled voted for Jefferson. Abigail Adams, in one of her letters, expressed the thought that Burr would make a pretty good president.
Thomas Jefferson, even though he did win the election, never forgave Burr for almost upstaging him, and the next time he ran for president, he did not choose Burr as a running mate. Another, far more permanent result of this election was that the constitution was amended. No more was the vice president to be the person with the second highest number of votes for president. From now on, vice presidents would be elected separately from presidents, thereby acknowledging the practical power of the political party.
Today, most people do not know about any of this. Some say it's a shame we have political parties, since that was not envisioned by the founding fathers. Not envisioned perhaps, but all the founding fathers who ran for office were involved in political parties, so while they may not have wanted them to exist for the other side, they certainly did use them when they themselves were running. People also do not remember that Burr and Jefferson were running mates on the same political party slate. Some contrarians even remember that the president and vice president were elected in the same election, but they do not remember that in order to get around the rules they themselves had made, founding fathers like Adams and Jefferson instructed their political flunkies to cast one vote for somebody they did not want elected at all, just so there would be a clear presidential winner on their party slate distinct from the vice presidential winner.
The historical facts can be quite astonishing. Sometimes it pays to revisit them.