Last July, The Guardian newspaper brought a challenge at the Court of Appeal against a judge's decision to exclude the press from a hearing that dealt with Philip's will.
But on Friday, the newspaper lost the Court of Appeal challenge.
WATCH: The Queen treats Prince George to a special birthday performance
Dismissing the newspaper's appeal, senior judges ruled that it was not a case where "fairness demanded that the media be notified of the hearing or asked to make submissions before judgment".
Sir Geoffrey Vos and Dame Victoria Sharp, sitting with Lady Justice King, said they could not see how the media could have been alerted to the fact the hearing was taking place "without risking the media storm that was feared".
They added: "The hearing was at a hugely sensitive time for the Sovereign and her family, and those interests would not have been protected if there had been protracted hearings reported in the press rather than a single occasion on which full reasons for what had been decided were published."
The Queen sat alone at Prince Philip's funeral last year
The judges also said the circumstances of the case were "exceptional". Sir Geoffrey Vos and Dame Victoria Sharp added: "It is true that the law applies equally to the royal family, but that does not mean that the law produces the same outcomes in all situations. These circumstances are, as we have said, exceptional.
"We are not sure that there is a specific public interest in knowing how the assets of the royal family are distributed.
"A perceived lack of transparency might be a matter of legitimate public debate, but the (Non-Contentious Probate Rules) allow wills and their values to be concealed from the public gaze in some cases. The judge properly applied the statutory test in this case."
Prince Philip died at the age of 99
Prince Philip passed away in April 2021, just two months shy of his 100th birthday. It is convention for the will of a senior member of the royal family to be sealed, following an application to the president of the Family Division of the High Court. This means the wills of senior members of the royal family are not open to public inspection in the way a will would ordinarily be.
In a ruling last October, the president of the Family Division, Sir Andrew McFarlane, ordered that Philip's will was to remain sealed for 90 years and may only be opened in private even after that.
Make sure you never miss a ROYAL story! Sign up to our newsletter to get all of our celebrity and royal news delivered directly to your inbox.