Why does the United States have a two-party system? It began with the Hamilton versus Jefferson rivalry when they were advisors to Washington. With the later drafting of the Constitution and the subsequent ratifying process, each state had to hold elections for people to vote on the new law. Since someone could only vote yes or no, two distinct groups of thought pooled together. The Federalists were for, the Anti-Federalists were against. Then after the Constitution was approved, these groups remained and started to expand their views on other issues. Throughout the next 200+ years, the parties changed their names as well, but mostly stayed with the spirit of two parties. The early way of the runner up in the presidential election becoming the vice president might also have something to do with lack of third party success, i.e. "first [two] past the post".
Other countries like the UK have a more diverse variety of parties because their parties are more specific. The US's parties are very broad representations of beliefs. Any American third party emerging as a strong party would probably be a result of either the Democratic or Republican party splintering. Roosevelt's Bull Moose party was an offshoot of the Taft-controlled Republican party, and has been the largest third party since.
Meanwhile in the present day, the socialist-minded Sanders' amount of enthusiastic support could be worth a splintering, or if Trump wins, the Republican establishment could break away.