Later at the White House, Mr Trump told reporters that he and the first lady "could hardly hear it from where we were", but his spokeswoman condemned the heckling.
Donald Trump booed as he visited Ruth Bader Ginsburg in repose
"The chants were appalling but certainly to be expected when you are in the heart of the swamp," Kayleigh McEnany told reporters. "I thought it was an appalling and disrespectful thing to do as the president honoured Justice Ginsburg."
Mr Trump is not accustomed to honouring political opponents, and his visit to the Supreme Court to pay his respects to Ms Ginsburg is a rare tribute by the Republican president.
He also rarely wears a face mask in public and has frequently mocked his Democratic opponent Joe Biden for doing so.
According to National Public Radio, Ms Ginsburg, during her final days, told her granddaughter, Clara Spera, that her "most fervent wish is that I will not be replaced until a new president is installed."
Despite Ms Ginsburg's plea and Democratic opposition, Mr Trump is pushing ahead with plans to replace the feminist icon on the court ahead of the presidential election.
"I think it's going to go very, very quickly," he told Fox News Radio on Thursday.
Mr Trump has pledged to nominate a woman to fill Ms Ginsburg's seat and the White House has been vetting candidates for confirmation by the Republican-controlled Senate.
"I have five women. I like them all," Mr Trump said.
He plans to announce his nominee for the lifetime post on the nation's highest court at the White House at 5:00 pm (2100 GMT) on Saturday.
'Important we have nine justices'
Ms Ginsburg's death last week at the age of 87 could allow Mr Trump to cement a conservative majority on the nine-member court for decades to come.
Democrats are demanding that the process of replacing Ms Ginsburg wait until after the election, when it will be known whether Mr Trump will serve a second term.
But Mr Trump says the post must be filled, in case the election is contested and ends up before the high court, a possibility that is raising tensions in Washington.
"I think this will end up in the Supreme Court. And I think it's important we have nine justices," the president said.
Republican senators insist they have the right to vote on the nomination either before the election or during the "lame-duck" session before the inauguration of the next president in January.
Two Republican senators have said they do not believe the vote should be held before the election.
But on Tuesday, Utah Senator Mitt Romney, who had been seen as a potential Republican holdout, said he will vote on the nominee "based upon their qualifications."
Although Democrats have no way of stopping the procedure, they will seek to inflict political pain on the Republicans over what Mr Biden called an "abuse of power."
Ms Ginsburg, who was affectionately known by her initials "RBG," has been lying in repose at the court since Wednesday and her casket has been visited by a steady stream of mourners.
On Friday, Ms Ginsburg, who spent 27 years on the court, will become the first woman to lie in state at the US Capitol.