West German Foreign Minister Hans-Dietrich Genscher, here on a hastily arranged one-day visit, got a stern lecture today from Soviet Foreign Minister Andrei Gromyko, according to the official Soviet news agency Tass.

The Tass account appeared to undercut Genscher's effort to play a greater role in East-West relations on the eve of new U.S.-Soviet arms talks in Geneva. It said Gromyko "expressed concern" over Bonn's alleged support of U.S. plans to seek a space-based defense system. West Germany has backed the research phase of what the Reagan administration calls the Strategic Defense Initiative and indicated willingness to join in it.

Gromyko was quoted as saying West Germany's contribution to space-weapons research would make it "an accomplice" in violation of the antiballistic missile treaty and "torpedoing" of arms control.

At a press conference, Genscher described the talks as "intense and comprehensive," and useful in improving the pre-Geneva climate.

While Tass said Genscher made a "general" declaration on behalf of improved East-West relations, "at the same time, he set forth the old known viewpoint of the Bonn government on the deployment of new American nuclear missiles and was trying to interpret the American actions in outer space in a distorted light."

Genscher spent 4 1/2 hours in talks and at a lunch with Gromyko and left this evening for Helsinki. He is then to stop in Warsaw, where he is to see Gen. Wojciech Jaruzelski to arrange an official visit to Poland at a later point.

Genscher said he stressed to Gromyko the opportunity for a "new chapter" in East-West relations and noted that Bonn was eager to make a contribution. "The European states should play an important role to ensure positive developments for relations between East and West. They should not be content to play the role of bystanders," he said.

Noting West Germany's efforts to improve relations with other East European countries, particularly with East Germany, with which it shares "the common responsibility of Germans," Genscher sidestepped questions about the reason for his sudden visit. He said his French counterpart Roland Dumas, due in Moscow next week, had for one welcomed his effort.

Other western embassies said their governments were given short notice of the Genscher visit and interpreted it as designed primarily for internal political purposes.

With arms talks to begin in Geneva next week, Genscher told reporters that the Bonn government is "convinced of the serious intentions of both sides and their desire to hold these talks constructively."

"But we are realists," he said. "One will not be able to score great successes overnight."

Bonn has given its support to the Reagan administration's research program for the so-called "Star Wars" project. Halting the program is the Soviets' top public priority going into the Geneva talks.

Last week, a statement by the Soviet Foreign Ministry singled out Bonn as being among the proponents of "transforming outer space into a springboard for aggression."

West Germany has also been the target of a Moscow campaign against "revanchism," which has charged elements in the Bonn government of fanning ambitions to reunite the two Germanys.

As the 40th anniversary of the defeat of Hitler's Germany nears, Bonn is anxious that the Soviet Union not intensify its negative attacks.

According to Tass, Gromyko brought up the issue of the postwar alignment, putting "special emphasis on the need for a strict respect for the territorial-political realities."

Gromyko referred to attempts by "certain circles" in West Germany to question borders that he said were sealed by the 1945 Yalta agreement and Helsinki accords.

William Drozdiak of The Washington Post added from Bonn:

According to Foreign Ministry officials, a key objective of Genscher's trip to Moscow was to stress that early progress in upcoming arms control talks on medium-range missiles should not be held hostage to superpower differences over space-based weapons.

Genscher asked early last week for a chance to expound on West German arms-control positions before U.S.-Soviet negotiations in Geneva. The Soviet Foreign Ministry cabled a response Friday suggesting the session yesterday and Genscher eagerly accepted, said officials.