The Supreme Court ruled unanimously yesterday that tenants of Sky Tower, a District of Columbia public housing project, were not entitled to federal relocation benefits when the Department of Housing and Urban Development decided to close the project after taking it over.

The Supreme Court ruling, written by Justice Thurgood, Marshall, reversed a split ruling of the U.S. Circuit Court of Appeals for the District of Columbia in 1977 that upheld a District Court award of relocation benefits to about 55 families. HUD had attempted to evict these families from the deteriorating Sky Tower apartment complex at Wheeler Road and Wahler Place SE.

The impact of the court's ruling yesterday was limited by a decision made by HUD, subsequent to the initiation of litigation, to turn the project over to the District of Columbia. The District also was the only jurisdiction in which federal courts had ordered HUD to pay relocation benefits to tenants facing a situation similar to that at Sky Tower.

The case came before the Supreme Court because the ruling of the Circuit Court here conflicted with a decision handed down by the 7th Circuit Court in 1977. That case involved 17 tenants evicted from the Riverhouse Tower Apartments in Indianapolis when HUD shut the project in 1975 after taking it over in 1970.

Sky Tower, a complex of three-story red brick buildings constructed in the 1950s, was taken over by a nonprofit corporation in 1970 for rehabilitation, using federal funds.

HUD foreclosed on the corporation in 1972, and took over the project in 1973 after a second developer also failed. In 1974 the management firm hired by HUD gave notice to the project's tenants tovacate so that HUD could level the project and sell the land to a private developer.

The tenants sued HUD, contending among other things that they were entitled to federal relocation benefits under a 1979 law. A federal judge barred HUD from coninuing the demolition of buildings it had started, and in late 1976 HUD and the district, government agreed to a sale of the remaining apartments to the city.

The evicted tenants did not meet the law's definition of "relocted" tenants, the court said yesterday, because HUD did not acquire the project with the intention of using it for a federal program-a key consideration in determining eligibility for benefits.

"We recognize, of course," Marshall said, "that an agency's intent in acquiring property appears irrelevant to those displaced by federal order. From a tenant's perspective, the cost of dislocation are the same regardless of whether an agency anticipated causing displacements when it acquired property. Nonetheless, Congress chose to condition eligibility for relocation benefits on the agency's purpose in acquiring property, and our function is not to rewrite the statute."