President Reagan and Spain's Socialist prime minister, Felipe Gonzalez, yesterday put aside aside their differences over Central America to hold a White House meeting that Reagan described as "exceptionally productive and cordial."

However, in a meeting later with staff members of The Washington Post, Gonzalez made clear that he disagrees with many aspects of U.S. policy toward Central America. He said there is "a basic coincidence" of views between him and Reagan that the region's turmoil is rooted in social and economic injustice and that a peaceful regional solution is preferable to military confrontation.

But he also made clear his belief that a resolution of the civil war in El Salvador can best be achieved by promoting negotiations between the government and its guerrilla foes rather than through U.S. military aid aimed at defeating the insurgents.

Gonzalez also distanced himself from Reagan's reported references in the White House meeting to the leftist Sandinista government in Nicaragua as a "failed revolution."

While acknowledging that there are restrictions on free speech and political pluralism in Nicaragua, Gonzalez noted that in El Salvador and Guatemala, whose governments have U.S. support, "it would be difficult to imagine any assessment . . . that would include respect for human rights."

Still, in their public statements after the White House session, the two leaders took an upbeat tone that underscored their determination to skirt Central America and put their emphasis on maintaining close ties at a time that Spain is completing the transition from decades of dictatorship to democracy.

A senior U.S. official, who declined to be identified and who spoke with reporters before the meeting, said the administration wanted Gonzalez' visit "to be almost a celebration of the fact that Spain has become a fully participating, democratic country." The United States is particularly hopeful that Spain, which is undergoing a debate over possible withdrawal from NATO, will decide to remain in the Atlantic alliance.

In that context, the official said after the meeting that Reagan had congratulated Gonzalez for recent remarks in Bonn. The official said Gonzalez had supported NATO's plan to deploy medium-range nuclear missiles in western Europe in December if the United States and the Soviet Union have not reached an agreement on reductions in this class of weapons by that time.

However, in his remarks at The Post, Gonzalez denied that he had used the word "support" in talking about the NATO missile deployment plan. Instead, he said, what he said was that if U.S.-Soviet negotiations are unsuccessful, Spain will "understand" if those western European countries fully integrated in NATO proceeded with deployment.

Gonzalez sought to play down emphasis on Central America. But, in response to questions, he reiterated his support for a regional, negotiated solution to Central American problems along the lines proposed by the so-called Contadora group of Latin American countries seeking to arrange such talks.

He also said: "My perception in this moment is that both the Salvadoran guerrillas and the Nicaraguan government are ready to negotiate, to negotiate seriously."

The administration has said it would support talks about the Salvadoran guerrillas entering elections scheduled to be held later this year, but it has strongly opposed the idea of negotiations that would give the guerrillas a share of power.

Gonzalez said he agreed that negotiations should center on "the electoral process, negotiating the democratic solution." But he questioned whether, given the "climate of violence that exists," the guerrillas should be expected to simply turn in their arms and go into elections without guarantees of fairness and safety. "These are terms that have to be made precise in the negotiations themselves," he said.