Trump knows he won't last in the Presidential race. Or he would have been serious in listening to campaign advisors and keeping his mouth shut when advisable to do so. No, he is doing this to further ensure fame to his name in the coming years, which has always been his entrepreneurial agenda and continues to be during his flash in the pan "campaign" of his.
What might be unintended (yet perhaps irrelevant to him) is the damage it is doing to the Republucan image as a whole. Not all his remarks and viewpoints are wholly self-imagined, and everybody knows it. They can easily be either found or inferred from the Republican platform in general, even if a bit extreme at times.
It's similar to the way terrorists make all Muslims look bad and the way Westburo makes all Christians look bad. No, not all Muslims believe in slaughtering non-believers and not all Christians believe God hates fags, but the simple fact that these extremists get their views from the same source as the moderates turns many others off from the source completely.