The D.C. Court of Appeals refused yesterday to permit the demolition of a 112-year-old former Masonic temple in downtown Washington, declaring that its owners had failed to prove the landmark structure could not be profitable if it were left standing and modernized.

A three-judge panel, citing the court-ordered preservation of New York's Grand Central Terminal in 1978 as a precedent, said developer Dominic F. Antonelli Jr. and his partner cannot demolish the former Julius Lansburgh Furniture Co. store on the northwest corner of Ninth and F streets NW merely because a new office building proposed for the site would be more profitable.

The now-vacant building was erected in 1867-69 and was used as a Masonic temple until 1908. Another landmark building, the Lansburgh Department Store at Seventh and E streets NW, is currently being used by a variety of city agencies and private art groups and is not affected by the court ruling.

Unless the building's owners manage by some means to get the decision overturned, they appear to have only the option of renovating the structure or selling it to someone who would do so, said lawyers familiar with the city's strong 1978 historic preservation law.

The decision was the second by the same court within a week upholding the Distirct of Columbia government's enforcement of the law. Last Friday, the court ruled that Carol Thompson, a city official representing the mayor, acted legally in approving the proposed demolition of the 181-year-old Rhodes Tavern, the oldest downtown commercial building, on grounds that it would be replaced by a project described as one of "special merit."

Yesterday the court held that Thompson also acted legally in rejecting the proposed razing of the old Masonic temple, which its owners had sought to justify solely on the grounds that preserving it would create economic hardship.

In its opinion, the court concluded that " . . . if there is a reasonable alternative economic use for the property after the imposition of the [historic landmark] restriction," a lower profit is not an "unreasonable economic hardship to the owners, no matter how diminished the property may be in cash value . . . " Judge John W. Kern III, who wrote the opinion, was joined by judges William C. Pryor and George R. Gallagher.

Michael A. Cain, principal lawyer for the building owners, voiced disappointment at the ruling and said its "broad language will make it difficult [for the owner of any historic landmark] to prove a hardship" in order to develop property. He said he would confer with his clients before deciding a further legal move, possibly an appeal for a rehearing before all nine judges on the court.

A further legal test of the landmark law is in the making. The owners of the Bond Building, 14th Street and New York Avenue NW, have filed a notice with the same court that they will appeal the recent refusal of Thompson, the mayor's representative, to permit its demolition on economic grounds.