Individuals with Narcissistic Personality Disorder (NPD) have a skewed perception of the world, with an extreme need for admiration and validation. Because of this, they have extreme difficulty with relating to other humans in a healthy way (via empathy). Instead, they only care that the other person 'feels' empathized-with and thus will continue to remain within the narcissist's circle of influence.
James Comey was undeniably an asset when he made the decision to reveal the investigation into Hillary's email server right before the election. He validated Trump's sincerely-held beliefs that Hillary was a criminal who deserved to go to jail. As such, Trump held Comey very close.
However, when it became obvious that Comey was not choosing to join Trump's inner circle (via the loyalty conversation in early 2017), Trump took it as a personal, not professional blow. Rather than see it as Comey being very serious about his job, he chose to see it as Comey 'turning' on him.
When the beginnings of the Russia Investigation began to surface (and thus the fact that the FBI had been investigating Trump's cohorts without telling Trump), Comey's value to Trump as a prize to be paraded around became less than his liability as a non-sycophant, and he was tossed away at Trump's first opportunity.