Here’s a good theory about what is going on:
It is evident that Trump has poor control of his emotions. This makes some sense; he was born with a silver spoon in his mouth, and has had a life full of wives, business partners, employees, television co-stars, and the like kowtowing to him and to his moods. He’s never really been in a position where he needed to learn emotional control. Beyond that, Trump sees himself as being in competition with Barack Obama (see, for example, the debate over the inauguration crowd). Putting it all together, the sequence of events seems clear: Trump is angry right now, he was given negative information about Barack Obama (whom he resents), and he lashed out. In fact, given the hour at which these tweets generally issue forth, we may even be able to paint a more detailed picture: Trump retires for the evening in a sour mood, tosses and turns, and finally jumps out of bed and uses Twitter as a release.
Also published on Medium.