The US president said McCain "didn't get the job done for our great vets and the VA" by refusing to appeal Obamacare and attacked him for "a war in the Middle East", in reference to the senator's support for the Iraq War.
"Not my kind of guy," the president said. "But some people like him and I think that's great."
What's the background?
The president revived his spat with McCain on Saturday by tweeting that the late senator had backed the so-called Steele dossier, an unverified 2016 document by a former British intelligence officer, Christopher Steele, claiming ties between Mr Trump and the Kremlin.
On Sunday, Mr Trump went after McCain again, saying the "last in his class" senator had sent "the Fake Dossier to the FBI".
Asked by a reporter about his attacks while hosting the Brazilian president at the White House on Tuesday, Mr Trump said: "I was never a fan of John McCain and I never will be."
Mr Trump has regularly clashed with McCain going back to his presidential campaign.
By Anthony Zurcher, BBC senior North America reporter
Donald Trump is feuding with a dead man.
It all began in 2015 when John McCain condemned then-candidate Trump's allegation that Mexico was sending rapists into the US.
Mr Trump responded by questioning the Arizona senator's heroism as a prisoner during the Vietnam War.
At the time there was a chorus of condemnation from across the Republican Party and predictions that the New York businessman's White House hopes were ruined.
It didn't turn out that way, of course. Mr Trump not only won the White House, he has moulded the Republican Party in his own populist, pugilistic image.
Now Mr Trump's outbursts against the late senator are met mostly with silence from within his own party. Georgia Senator Johnny Isakson stands out as one of the few to sharply rebuke the president's remarks.
Mr Trump clearly believes leaning into this now one-sided fight benefits him politically. There are plenty of conservatives who never liked McCain, and they will love the president even more for not backing down.
The feud helped launch Mr Trump's presidential bid, and it's a wave he will ride till the very end.
What's the reaction?
Mr Trump's attacks this week on McCain have drawn sharp condemnation from across the political spectrum, with Republican Senator Johnny Isakson calling the remarks "deplorable".