Two weeks after he was refused a chance to speak in Moscow at official celebrations of the 60th anniversary of the Russian Revolution, Spain's independent-minded Communist leader Santiago Carrillo came to Washington yesterday and was promptly given a chance by the U..S government to be heard - inside the Soviet Union.

Without Carrillo's knowledge, a mid-morning press conference at Johns Hopkins University was taped for broadcast to Eastern Europe and the Soviet Union by Radio Free Europe and Radio Liberty, U.S. government-financed radio stations founded to fight communism. That stations' main transmitters are in Spain.

Also underlining the ironies that abound in the 11-day visit Carrillo is making to three American universities is the fact that the Carter administration made a policy decision not to listen to Carrillo's "Eurocommunist" message itself, and pulled out all the stops last week to build up a similar visit to Washington by Carrillo's chief rival for influence and power in Spanish opposition politics, Socialist leader Felipe Gonzalez.

Carrillo did not appear to be upset by the taping of his remarks by Radio Free Europe nor by the calculated official decision here to give him a cold shoulder and Gonzalez a warm embrace.

The radio taping "is no problem," he said in an interview after delivering a lecture at Johns Hopkins School for Advanced International Studies. "Many others are anti-Communist and I speak to them too. You have to speak to everybody. As for the government, I did not ask or expect to have official interviews."

Carrillo has been sharply ritical for nearly a decade of the "primitive" state of socialism and human rights in the Soviet Union. The Kremlin has retaliated with bitter attacks on Carrillo and has implicitly warned other Communist parties not to follow his independent course.

Tom Bodin, U.S. news editor for Radio Free Europe and Radio Liberty, denied that the stations were attempting to use Carrillo's remarks as anti-Russian propaganda. "We function as a normal radio station. We would do the same thing with any one of importance to our audience area," he said.

The 36-year-old Gonzalez, whose Socialist Party captured nearly 30 per cent of the popular vote in June's parliamentary elections, spent two hectic days in Washington last week meeting with Vice President Mondale. Secretary of State Cyrus R. Vance, National Security Adviser Zbigniew Brzezinski and other officials.

"The U.S. government is showing it understands, the importance of the Socialistist Party in the process of eliminating the barrier that has stood between the U.S. governments of the past and the Spanish people, during the time the United States dealt only with the dictatorship" of Generalissimo Francisco Franco, Gonzalez said in an interview conducted in a hotel coffee shop here on Friday.

The evidently deliberate juxttaposition of visits to Washington by the two opposition leaders brought into sharp focus the continuing importance of the American role in Spain two years after Franco's death.

At one level, it provided the Carter administration the most concrete opportunity it has yet had to back up the more nuanced position it has adopted on "Eurocommunism," defined by Carrillo and others as an effort to blend Marxist principles and Western democratic traditions and freedoms.

By allowing Carrillo to become the first Western European Communist leader to visit the United States since the Cold War began, the administration is improving its record on international freedom of movement and freedom of speech, as emphasized by the Helsinki accords and President Carter's own human rights declarations.

While this is a departure from the rigid and hostile position on Eurocommunism adopted during the Kissinger era at the State Department, U.S. officials add that the subsequent freeze-out of Carrillo here "makes it clear that we support friends and do nothing to make it easier for Communists."

The two visits have also emphasized the intricate struggle the two Spanish politicians are waging at home and their proximity to power. The Communists only scored 9 per cent of the national vote last June, and Carrillo admitted that in contrast to Gonzalez's high-level contacts with policy makers, he has been limited to seeing students and faculty members.

"It may be a small group, but you have to work for the future," said the 62-year-old Carrillo, who returned to Spain only a year ago after 39 years of exile. "Within these groups are the policymakers of tomorrow, and I wanted them to see that a Communist can be a reasonable, tranquil man who is not intent or waging war against the United States."

The visit by Gonzalez was quickly laid on through aninvitation from the United Auto Workers after Carrillo accepted invitations to speak at Yale, at John Hopkins in Baltimore and Washington and at Harvard. He left Washington for Boston yesterday.

"I would have refused to come under previous administrations," Gonzalez said in an upbeat appraisal of the Carter administration. "The image men of my generation have is that of Eisenhower, Nixon and Ford coming to my country to visit the dictatorship."

Gonzalez denied that the trip had been arranged to show that he was on good terms with the U.S. leadership. "There is no electoral or publicity aspect of this visit. The auto workers are being a bridge of communication between our peoples."

Carrillo asserted that he was "glad that Gonzalez came and had all these meetings. In Spain he is always trying to pretend to be more leftist than we are, but his voyage shows that he isn't." Carrillo suggested that the ruling Socialist Democratic Party of West Germany, which has given extensive support to Gonzalez's party, had prevailed on the Carter Administration to arrange the reception for Gonzalez, but he could offer no evidence of this.