St Margaret's Children and Family Care Society, in Glasgow, was told earlier this year that prioritising those who have been married for at least two years discriminates against same-sex couples.
The Office of the Scottish Charity Regulator reviewed the practices of the charity in January after a complaint from the National Secular Society (NSS) and in a report found it was breaking the Equality Act 2010.
The regulator said marriage is not available to same-sex couples and that the charity's policy constitutes direct discrimination.
It ruled that St Margaret's failed the charity test and issued a direction for it to amend its procedures, or risk losing its charitable status.
St Margaret's challenged the watchdog's decision, but the ruling was upheld.
The charity now has until April 22 to comply or it could be removed from the register.
Alistair McBay, spokesman for the NSS, said: "We hope St Margaret's will now put the best interests of children first, as many other Catholic adoption agencies have done, and comply with the law by widening the pool of prospective parents to include same-sex couples."
A spokesman for the charity said: "We are disappointed. We will consult our lawyers before considering what action to pursue."
A Scottish Government spokesman said: "We do not believe it is in anyone's interests to close an organisation which provides such a valuable service to vulnerable children."
The charity now has the right to appeal to the Scottish Charities Appeal Panel.