I think Trump probably posted that thinking it was funny and that he'd be trolling people. Very unbecoming of a sitting president of the United States, but whatever.
I also think he actually believes he could pull off developing Gaza like that.
That said, it's all fun and games until his rhetoric and stupid posts radicalizes some Palestinians and they decide to enact retribution in a major US city. I sincerely hope I'm wrong about that, but no one would be surprised if it happened. I mean threatening a middle eastern population with ethnic cleansing and joking about it always seems to go well...