You think he intended to win? You think he intended to run? That's hilarious.
He came down the stairs and gave his racist speech as a negotiating tactic with NBC for better salary for the apprentice. They promptly fired him because of it.
Then he realised there was another grift to be done just by running. He never intended to win and he never expected to win.
So yes, he won by accident.