Simple. Iran keeps dangling a deal in front of Trump like bait on a hook.
Every time it looks like talks are about to collapse, Iran gives just enough ground to make Trump think, "We're almost there, just one more compromise." The closer he thinks he is to getting a deal, the more invested he becomes in protecting it.
Then Iran has Hezbollah or another proxy stir up trouble with Israel. Israel responds, as it always does, and Iran immediately turns around and says, "See? We were about to make a deal, but Israel is about to ruin it."
At that point, Trump's frustration is directed at Israel instead of Iran. Because he is emotionally and politically invested in getting the deal done, he starts viewing Israel's response as the obstacle rather than Iran's behavior.
The result is that Iran gets Washington spending more energy trying to restrain Israel and save negotiations than confronting Iran itself. The deal becomes the carrot, and Trump ends up chasing it while Iran controls the pace.
The goal is not necessarily to get a deal. The goal is to keep America believing a deal is always one step away, long enough to weaken its resolve, create friction with its allies, and reduce its willingness to escalate the conflict.