A federal district court judge has upheld the right of Vista to restrict its volunteers from participating in demonstrations.

The American Civil Liberties Union had sought to lift the ban the Reagan administration had imposed on agency employes. But U.S. District Court Judge Oliver Gasch ruled last week that the demonstration ban did not violate the First Amendment or the Hatch Act (which governs the political activities of federal employes) as ACLU lawyers had charged.

The controversy arose last fall when Vista proposed a set of tentative guidelines that would have imposed a round-the-clock ban on demonstrations.

The agency's leaders said the ban was designed to help the agency shed its earlier image as a haven for confrontational politics. Because Vista volunteers are supposed to live full-time among the people they serve, the ban was to apply to employes' off-duty hours, too.

The ACLU cried foul, and partly as a result of its protest, the agency's final regulations, published in January, said the ban would not apply when volunteers were off the job.

The ACLU, representing the Children's Foundation and other defendants, proceeded with its lawsuit anyway, claiming the ban was unconstitutionally vague and violated free speech guarantees. Gasch, in a 14-page opinion, upheld the ban on all counts.

Vista is scheduled to go out of business in October, 1983. Vista director James Burnley, who imposed the ban, left the agency Friday to become special assistant to the deputy attorney general at the Justice Department.