Mr Trump admitted he "was not a big fan" of the late senator "in any way, shape or form", but said: "I would never do a thing like that."
"Now, somebody did it because they thought I didn't like him, OK?" he said leaving the White House on Thursday.
"They were well-meaning, I will say," he added, while insisting he was kept in the dark.
The Wall Street Journal said a US Indo-Pacific Command official wrote an email to Navy and Air Force officials about the president's arrival in Japan over Memorial Day weekend.
It included instructions for the proper landing areas for helicopters and preparations for the USS Wasp, the ship on which the president was to speak.
The official then issued a third instruction: "USS John McCain needs to be out of sight," according to the email, whose existence was confirmed to the Associated Press by three sources.
When a Navy commander expressed surprise at the instruction, the US Indo-Pacific Command official is reported to have answered: "First I heard of it as well," the Wall Street Journal reported.
Mr Trump - who feuded with Mr McCain publicly for years and at one point mocked his military service - earlier tweeted he "was not informed about anything having to do with the Navy Ship USS John S. McCain during my recent visit to Japan".
I was not informed about anything having to do with the Navy Ship USS John S. McCain during my recent visit to Japan. Nevertheless, @FLOTUS and I loved being with our great Military Men and Women - what a spectacular job they do!
Acting US Defense Secretary Patrick Shanahan told reporters he "never authorised" and "never approved" activities involving the USS John McCain around the time of President Trump's visit.
The Wall Street Journal said a tarpaulin was placed over the USS John S McCain's name before Mr Trump's arrival, according to photos it reviewed, and that sailors were instructed to remove any coverings from the ship that included its name.
Navy Commander Clay Doss, spokesman for the US 7th Fleet, said the tarpaulin was on the ship on Friday but was removed by Saturday morning, the day Mr Trump arrived, adding: "All ships remained in normal configuration during the president's visit."
Asked if the tarpaulin was meant to block Mr Trump's view of the ship, US officials said it had been placed on the ship for maintenance and removed for the visit.
Rear Admiral Charlie Brown, Navy public affairs officer, tweeted: "The name of USS John S. McCain was not obscured during the POTUS visit to Yokosuka on Memorial Day.
"The Navy is proud of that ship, its crew, its namesake and its heritage."
The Journal reported that sailors on the USS John S. McCain, who usually wear hats with the ship's name on, were given the day off when Mr Trump visited.
Mr Trump and Mr McCain had a frosty relationship and that continued, on Mr Trump's part, even after Mr McCain died of brain cancer in August 2018.
In 2015, Mr McCain, a Republican senator from Arizona, got under then-candidate Mr Trump's skin by saying he had "fired up the crazies" at a rally in Phoenix. Mr Trump later told a crowd in Iowa Mr McCain was only a war hero "because he was captured. I like people who weren't captured".
President Trump was not welcome at Mr McCain's funeral and raised the White House's US flag back to full-mast shortly after his death, despite US Flag Code stating it should remain at half-mast for another day.
Mr McCain's daughter Meghan tweeted on Wednesday that Mr Trump will "always be deeply threatened by the greatness of my dad's incredible life".