The true answer is, of course, “nobody fucking knows” except (possibly) the man himself. For whatever reason, his brain thinks it’s a good idea. His brain is probably a scary place to be, frankly.
So, I don’t know. But I do have my own theory. Deep down, I think, Trump knows he isn’t going to win. That certainly matches with his observable behavior. However, it seems like he is a goal-oriented person, so he’s not doing nothing, or doing random shit — he’s got something that he wants. And I think he wants to do damage.
He wants to sit in his penthouse on November 9th, and watch the country burn. He wants to call into Fox News and tell everyone, “See, I told you so.” He can’t play with the toys any more, so he wants to break them.