The Office of the Scottish Charity Regulator (OSCR) said Loretto School in East Lothian had insufficient measures in place to widen access for pupils from poorer backgrounds.
The regulator said a further eight schools had passed the test and would keep their charitable status, which allows for tax breaks and rates relief.
Loretto, where former chancellor Alistair Darling and BBC journalist Andrew Marr went to school, charges more than £19,000 a year for senior day pupils and up to £28,590 a year for boarders.
The Musselburgh school now has 18 months to convince the regulator it can comply with its tests.
Martin Tyson, OSCR's head of registration, said: "As regulator, we must ensure charities provide public benefit as set out in the legislation. Of the decisions announced today, eight schools have satisfied us that they provide a sufficient level of public benefit."
Jonathan Hewat, Loretto's director of external affairs, said: "Although OSCR acknowledges the valuable public benefit Loretto School already provides, it has identified improvements it wishes to see implemented.
"We are naturally disappointed by this outcome, but strongly believe that, by working with OSCR, we can satisfy the requirements of its charities test within the prescribed timescale. We are looking carefully into OSCR's report with a view to meeting the charity test as soon as possible."
In 2011, four private schools - Hutchesons' Grammar in Glasgow, Merchiston Castle in Edinburgh, Lomond School in Helensburgh and St Leonards in St Andrews - were allowed to keep their charitable status after a three-year investigation by the regulator. OSCR said the probe had significantly widened access to the schools.
The eight schools that passed the regulator's latest test were Lewis Christian Education Association on Lewis, Mannafields Christian School in Edinburgh, the Moray Steiner School in Forres, Compass School in East Lothian, Lathallan School in Montrose, Hamilton College, Albyn School in Aberdeen and Glasgow Academy.
Meanwhile, the Scottish Council of Independent Schools published new figures showing £35 million has been awarded in bursaries by the sector in the current school year.