As others mentioned, this relates to how first-past-the-post voting works with the presidency. Duverger's law says that the voting for any single post will devolve to two parties. This happens because tactical voting means that people will tend to vote for the lesser of two evils rather than the third party that has no chance.
Now, you might immediately point out that the United Kingdom (UK) has both first-past-the-post voting and more than two parties. The difference is that in the UK, there is no single election that forces voters to align into two parties. Instead, each seat in parliament is a separate election. Most seats will still only have one or two serious candidates. But a third party can participate because of support from other seats where they are more serious. After the election, the parties can team up to form a government.
In the United States (US), the presidential candidates run directly. If a candidate wins, that person becomes president regardless of the results of the legislative elections. For example, the Democrats held the House of Representatives continually from 1958 to 1994, but during that time, Republicans held the presidency for twenty-two of the thirty-six years.
It's also worth noting that in that period, there were three different major third party attempts: George Wallace (1968); John Anderson (1980); and H. Ross Perot (1992). But it's hard for a failed party to persist. By their nature, presidential campaigns are national. Of those three, only Wallace was regional. And he didn't take his legislative supporters with him, as they would have lost the benefits of support from their existing party.
You might contrast that with how things work in the UK. A regional party (e.g. the Scottish National Party or SNP) can immediately join either the government or the opposition. In the US, a candidate in such a party would lose the advantage of presidential endorsement. Because presidential campaigns are national, they compete in each congressional district. So the party can support a candidate trivially by adding the candidate to the ticket. In the UK, the legislative candidate would head such a ticket in most places. In the US, it's the president.
Is it impossible to have a third party in the US system? Certainly not. Look at the 1860 election. Prior to that, the Democrats and the Whigs were the two parties. After that, the Democrats and the Republicans were. But note how everyone still picked sides. They just changed the alignment.
Lesser changes happened in other elections. Wallace took his voters away from the Democrats in 1968, and the Republicans won five of six presidential elections. Perot took his voters out in 1992 and Democrats won a plurality of the popular vote in five out of six presidential elections.
Things may not be as different as they first seem. Yes, parliament has multiple parties. But when was the last time that the prime minister was neither Labour nor Tory? Your prime minister is also chosen from just two parties. The difference is that your politicians can form alliances after the election while in the US, voters have to figure out alliances before the election. So our versions of Arlene Foster and Gerry Adams join one of the existing parties before the election rather than forming coalitions with them after the election.