NY Times published a comprehensive editorial on April 8th about unpredictability of Trump and his policies.
Is Trump a tactial genious or acting out his unpredictable emotions?https://www.nytimes.com/2017/04/08/us/politics/trump-doctrine-foreign-policy.htmlhttps://www.google.com/search?q=The+Emerging+Trump+Doctrine:+Don+t+Follow+Doctrine&ie=UTF-8&oe=UTF-8&hl=en-us
Is the answer though simple - Trump is trying to show the World that he is unpredictable and is trying to do as much as possible opposite of Obama.
The world said Trump is Putin's puppet, and he confronts Putin.
The World said he doesn't care about other countries and Syrians refugees, and Trump sends US strikes to Syria to show that he cares. Knowing that Obama elected not to send US troops to Syria after 2013 chemical weapon attacks, made Trump's decision easier.
His strategy is to differentiate himself from prior Obama administration and use tactical moves to selfishly establish some level of credibility, or stated more accurately reverse the political attacks against him.
The other theory is that Trump is highly emotional and egotistical, and just gets a kick out of acting out his emotions.