Spaniards go to the polls this week to choose a government. It will be the third national election since democracy was reestab-lished in 1977. It may well be the first in which the ''outs,'' in this case the Socialist Party, oust the ''ins,'' the crumbling centrist coalition which has governed for the past five years. If that happens, the elections will be of signal importance: One of the tests of a democracy is whether there can be peaceful alternation of parties in power.
The reemergence of democracy in Spain after 40 years of dictatorship should be a cause for rejoicing in the Western world. The Spanish Civil War marked the first of a series of betrayals of freedom by the leaders of the Western democracies that contributed to the spread of Nazism. The survival of fascism on the Iberian Peninsula, in Portugal as well as Spain, for three decades after the fall of Hitler and Mussolini was a blot on the Allied victory in World War II.
Yet Americans seem largely indifferent to what has been happening on the peninsula. Only in 1974-75, when there was chaos in Portugal in the wake of the fall of the Salazar/Caetano regime and the Communists seemed poised to grasp total power, did the rest of the world pay attention. As soon as democratic forces seemed to have things in Lisbon under control, Portugal disappeared from the American press.
Similarly, in Spain it is only the high drama, such as the sporadic terrorist attacks or the coup attempt in 1981, that merit the occasional headline. Sad to say, this indifference is reflected in Washington, where attention to Spain and Portugal focuses almost exclusively on the problems of securing the continuation of US base rights in both countries.
Does this benign neglect matter? Yes, it does. Important Western interests are at stake in the fate of free institutions on the Iberian Peninsula:
* Democracy in both Portugal and Spain is still a fragile plant, struggling against the blight of economic recession and centuries of authoritarian tradition and habits. Because of the sorry story of the 1930s, the failure of democracy in either country would be a blow to Western morale. It would also have an impact on perceptions in the third world, especially since Portugal and Spain supposedly enjoy a special relationship to the stronger Western democracies. Americans and Europeans should care even more about how democracy fares in Portugal and Spain than in places like El Salvador.
* The collapse of democracy in either country would produce severe strains within the Western alliance. Both countries are NATO allies, both are candidates for membership in the European Community. A number of West European democracies would feel compelled to ostracize a Spanish or a Portuguese dictatorship, much as was done when the two countries were ruled by Franco and Salazar. A NATO alliance divided on the issue of dictatorship vs. democracy would be a weaker alliance.
* Even America's narrow interest in maintaining base rights would be jeopardized if democratic institutions did not succeed in the two countries.
If an authoritarian regime were to take over in either Spain or Portugal, the US would not easily go back to the situation prevailing before 1974-75, when it was able to maintain bases in the Iberian nations in spite of the undemocratic character of their governments. Base rights require money and the US Congress is no longer the compliant provider of funds to an expedient Executive Branch foreign policy that it once was. The issue would be as divisive in the US as El Salvador has been.
The Portuguese and Spanish peoples have made a choice - to ''join the West'' after decades, some would say centuries, of self-imposed exile, of looking to other worlds and other values. ''Joining the West'' for them means practicing democracy, becoming members of the European Community, and assuming a full role in the NATO alliance. Yet, the two nations are encountering serious obstacles in achieving these goals.
Democratic political parties in both countries have yet to prove themselves capable of coping with the challenges which history and circumstance have thrust upon the two nations: growing unemployment, high inflation, and foreign indebtedness in both; in Spain, the regional autonomy issue, terrorism, and the role of the military; in Portugal, a growing sense of aimlessness brought on by the constant guerrilla warfare between the President and the parties, and within the parties themselves.
On the external front, the entry of both into the EC has been delayed, largely because of disarray in the community itself and the resistance of vested interests in certain EC countries to Spanish competition.
Finally, the role of the Iberian countries in NATO could become the source of the greatest disappointment with the Western option. Spain has just become a member of NATO but the Spanish military, many of whom are still suspicious of the new political dispensation at home, are already finding that their expectations that NATO membership would bring low-cost access to military equipment from abroad were unrealistic.
In Portugal, disappointment with NATO (and fear of being overshadowed by the new ally next door) are already serious problems. The Portuguese believe that the allies, including the US, have fallen far short of their obligation to help their armed forces acquire the equipment they need to assume a credible NATO role, after years of being a pariah in NATO circles because of the colonial wars in Portuguese Africa. The low level of military assistance is particularly galling to the Portuguese because of the strategic importance of the airbase in the Azores.
The picture is not all gloomy, of course, In both countries there are strengths - the prestige of King Juan Carlos in Spain and his total commitment to democracy, the innate moderation and conciliatory spirit of the Portuguese people, and in both countries an obvious desire of the great majority, as demonstrated by a high level of participation in election after election, that democracy and the Western option succeed. Yet if some of the disturbing trends cited above are not corrected, the time may come, some years down the road, when those leaders who in 1974-76 chose the democratic, Western path are discredited. In both countries there are others with different values and objectives who then would come to the fore.
The Spanish elections merit our applause and satisfaction. They should also remind us of what all of us have to lose if things go wrong on the Iberian Peninsula. Democratic forces in Spain and Portugal need more attention and support from Western capitals than they have been getting.