Trump has played his cards in regards to McCain..He tosses stuff out to the rabid supporters at his rallies and sees what plays best. Shitting on McCain plays well, so he knows he needs to keep his distance on giving him any praise.
Trump is a showman, he understands his base and knows just how deplorable he needs to be to keep their support. Offering any praise of McCain now would make him look weak, and it doesn't earn him any supporters.
Sure, there's a base-level hatred he has of McCain that drives him, but he knows that his McCain hatred also satisfies his horde of rabid supporters, so he plays it up publicly, like scrapping the White House's public statement honoring McCain. Or raising White House flags to full-staff less than 48 hours after McCain died and before burial.
Trump definitely knows what appeals to his base, and what doesn't. Praising McCain in death wouldn't play well. Snubbing McCain in death is totally calculated. If his base reacts negatively to all this, he could change today. He could pretend that he and John were besties forever, pour buckets of praise over his head, while standing close enough to ensure that most of it splashes onto himself.