I don't know the core reason, but by splitting society and making himself anti-Obama, he unites all people with the same thought to vote for him. So as consequence, he gain votes, thus it is benefical to him to hate somebody at the time.
It is just one of strategies thought. It may backfire if support for Obama was strong. It was not as Obama did some mistakes as any other politician. And for me, it seems Trump does some as well.
I would feel better if we valued former representatives for the good they have done.