His ego got the better of him in the end, as always. He couldn't take being taken down a peg or two.
I don't think his issue with Markle was racially motivated by the way. But while frothing at the mouth he made himself seem like that was plausible by some of his comments and vitriol.
I think his issue is that he is desperate to be accepted by the establishment, the rich and the famous. See how he sucked up to Trump as an example, then once rejected by Trump he lashed out at him.
Markle had talked to him in the past, but when she got married she stopped speaking to him, clearly under orders from the royal family, because he is a weazel who cannot be trusted, and they remember that from his days as a print news editor. When she stopped taking his calls/emails/tweets, he felt that deep seated feeling of not being accepted, not being good enough, thinking he had an 'in' to the royals but then seeing it fall away. This is when his attitude to Markle changed and he went all out attack like a psychopath on full rage. He focussed on her as the embodiment of his failure to ever truly be accepted by the good and the great. The fact it was a woman that emodied it hurt his raging male pride, that it was a black woman, and an american, and a C list celeb, must have shook his ego to the ground. Thus his war on Meghan started.
It's poetic that it was reporting on that interview that cost him his job in the end. He'll blame her, and try and find an outlet to be cruel to her rather than look at himself. But he's fast running out of friends, and has proven himself unreliable once again.