A federal judge here ruled yesterday that members of the Community for Creative Non-Violence have a constitutional right to sleep in tents they have erected in Lafayette Square across from the White House, but he immediately postponed the effective date of his decision pending review by the federal appeals court.

U.S. District Judge Charles R. Richey said that the right to sleep in the tents was part of the group's overall expression of its views and thus came within the First Amendment's protection of free speech.

The National Park Service had given the group, which is protesting the lack of housing for the homeless, a permit to erect the tents, which are now standing in the northwest corner of the park and have been dubbed "Reaganville."

The Park Service, however, declined to let the protesters sleep in the tents. Government attorneys had argued that camping, including sleeping and eating in the tents, was not necessary for the protesters to express their concerns.

Richey, however, said yesterday that the demonstration required the presence of the protesters and that their presence required that they sleep in the nine tents that have been standing since Nov. 30.

Richey said the protesters could sleep in the tents as long as they did not disturb the peace or damage the grounds in the park.