The Supreme Court ruled yesterday that the city of Memphis did not commit an act of discrimination in building a physical barrier between an all-white and an all-black neighborhood.

The court ruled 6 to 3 that the barrier, which blocked traffic between the white neighborhood and a black neighborhood to the north, was a legitimate attempt to control the flow of traffic at the request of the whites and was not racially motivated.

Justice Thurgood Marshall, writing the dissent, called erection of the barrier a thinly veiled and unconstitutional effort to "carve out racial enclaves."

The Hein Park Civic Association, representing the white neighborhood in Memphis, sought the street closing in 1970. The street's uninterrupted path through the two neighborhoods made it a busy and congested thoroughfare that threatened the safety of children and caused pollution, the association said.

Blacks challenged the street closing in court, and the 6th Circuit U.S. Court of Appeals blocked it by invoking the 13th Amendment, which bans slavery.

The street closing itself did not constitute slavery, the court ruled, but was a "badge" or a "symbol" of slavery and a violation of the Civil Rights Act of 1866, which granted blacks full property rights following the Civil War.

The street closing benefited a white neighborhood at the expense of blacks, limited contact between the two races and lowered property values in the black section, the appeals court held.

Supreme Court Justice John Paul Stevens reversed that ruling yesterday, saying there was no evidence that the street closing was racially motivated. He said it also was unclear whether the 13th Amendment "did anything more than abolish slavery."

"Proper management of the flow of vehicular traffic within a city requires the accommodation of a variety of conflicting interests," Stevens wrote. ". . . In this case, the city favored the interests of safety and tranquility."

The action did inconvenience some people, not because they were black but because they happened to use the street that was closed, Stevens noted.

"That inconvenience cannot be equated to an actual restraint on the liberty of black citizens that is in any sense comparable to the odious practice the 13th Amendment was designed to eradicate," Stevens wrote.

Marshall, joined in dissent by Justices William J. Brennan and Harry Blackmun, drew an opposite conclusion.

"The stated explanation for the closing," Marshall said, "is of a sort all too familiar: 'protesting the safety and tranquility of a residential neighborhood' by preventing 'undesirable traffic' from entering it.

"Too often in our nation's history, statements such as these have been little more than code phrases for racial discrimination."

Justice Byron White concurred in the judgment, but criticized the other justices for second-guessing the lower courts' interpretation of the facts in the case.