"Obama made a very bad deal with Iran. I am a master negotiator, no one negotiates better than me, believe me. I will negotiate a beautiful, shiny new deal with Iran when I meet with Mr. Rouhani. He said some very nice things about me, I think he likes me very much."
Basically. His motivation for doing things is spite, personal grievances and trying to bolster his image.