From the perspective of the US president being seen as 'leader of the free world' and the US as global superpower, it's a pretty terrible move with no discernible foreign policy advantages, and obvious disadvantages (even if I'd agree that many people are exaggerating those).
But then, this is the 'America first' president. Why should the US keep having to play the role of the responsible adult who will create peace in the Middle East? Why shouldn't Trump have as much right as, say, Erdogan to ignore responsible foreign policy and just do whatever is most convenient to him in his domestic politics at any given moment? And then the fact that he's annoying almost literally every country in the world except Israel is irrelevant - or actually, it's even a feature rather than a bug. As Mook's reply shows, pissing off foreign countries and the American foreign policy establishment is a vote-winning strategy and a goal in itself for more Americans than you'd think, not only among the die-hard Trump fans.
As several others have pointed out, Trump is simply keeping a promise that was also made but then broken by several previous presidents, and finally executing a decision already taken in principle more than two decades ago. Those earlier presidents, like Trump, were willing to make stupid counterproductive promises to get elected - but, once elected (or very possibly already at the time they made the promise), they realized that actually keeping that promise would make things worse, and ignoring their promise was the best thing to do even if it made them look hypocritical. Trump however has never made any kind of switch from campaigning to governing; he doesn't give a damn about 'the responsible thing to do', any foreign country's interests or indeed even America's interests except to the extent that he can make himself look good, just as if he were still campaigning. So for him, this decision is pretty much a win-win.