Spanish voters endorsed a new constitution yesterday but a lower than expected turnout marred the outcome for the government.

With about half the vote counted after 2:30 a.m., only 66 percent of the electorate appeared to have voted on the democratic consitution that they were offered to replace the fundamental laws of Generalissimo Francisco Franco's 40-year dictatorship. Of thoes who actually voted, however, 87.8 percent were approving the constitution.

The government had predicted that there would be a turnout of 75 to 80 percent and that 90 percent of those voting would say yes to the new constitution.

The weakness of the endorsement may prove to be a major setback for the laborious implantation of democracy that had proceeded without major problems since the death of Franco three years ago.

This referendum cannot be considered in the same light as a normal election, but was on the basic document under which Spaniards will live in their new democratic system.

This referendum cannot be considered in the same light as a normal election, but was a vote on the basic document under which Spaniards will live in their new democratic system.

For months, Spanish leaders were saying that the level of approval in such a test of their form of government should be 70 to 80 percent to make it work.In the combined houses of parliament, the draft text received more than 90 percent approval.

Since the results seemed to be coming from regions all across the nation, it seemed unlikely that the trend would be upset.

It showed that the combined total of no votes, blank ballots and the stay-at-homes was running at a rate of 41.5 percent of the total electorate. There was an active boycott campaign in which voters were made to understand that failure to vote would be counted by the anti-constitutional forces on both the extreme right and left as an endorsement of their hostility to the new consitution. So far the tallies show nays at 8.6 percent, blank ballots 3.6 percent and non-voters 33.5 percent.

The government could be expected to put the accent on the high percentage of yes ballots. But it was far less impressive than the 1976 referendum, which authorized the democratic forces that replaced Franco to write a new constitution. In that vote, the nays, blanks and asbtainers totaled 27.4 percent, with 73.2 percent of the total electorate voring yes.

In the Basque country, where separatist groups campaigned the hardest for a boycott of the vote or for a no vote, about 55 percent of the voters apparently stayed home. Of those who actually voted, a partial count shows 66 percent asaid yes and 33 percent said no or cast blank ballots. The rest were invalid.

Eleven separatist groups there had campaigned for a boycott of the vote or for a no vote. Early returns from the Basque country showed a turnabout of about 60 percent.

The violent extreme leftist Eta (Basque Homeland and Liberty) group backed up its campaign against the constitution with a wave of assassinations that culminated yesterday in the murder ot two police inspectors and a municipal policeman.

The legal Basque National Party, which had also called ofor a boycott of the referendum, was accused today by the ruling Center Democratic Union and the Socialist Party of having tried to intimidate voters by asking their names as they stood in line to cast their ballots. Basque nationalist pollwatchers allegedly demanded that voters put their home addresses on the envelopes into which they stuffed their ballots. The party issued a demnial.

Among the first voters were King Juan Carlos and Queen Sofia. Several hundred persons chanted "long live the king." to the 40-year-old monarch that Franco had chosen as his successor. He has played the central role in the return to democracy by keeping the largely Francoist armed forces generally in line during the three years since the dictator's death.

Only three weeks ago, a military plot to overthrow the government was uncovered. Its full extent has to be revealed. The government has tried to minimize its importance but Socialist and Communist leaders and diplomats of the top Western embassies are taking it very seriously.

The primate of Spain, Cardinal Marcelo Gonzalez Martin of Toledo, called on Catholics to vote no becasse of the "Godlessness" of the constitutional text. High government officials admit privately that Cardinal Gonzalez's pastoral letter was the single most damaging factor in the opposition campaigns of the extreme right and the extreme left. Premier Adolfo Suarez devoted his final appeal for a yes vote to a rebuttal of the primate.

The attacks of the old Francoist had the effect of making he main parties of the left, the Socialists and Communists, redouble their expressions of ardor for a text about which the Socialists in particular had expressed many reservations during the 15-month negotiations to produce it.

The more heavily the left endorsed it, the more the right found grounds to reject it as a leftist document.

The center, almost exclusively embodied in Suarez' ruling Center Democratic Union, found itself pushed leftward. This turn of events may influence the next phase in the Spanish political process.

Suarez has o0 days after the official proclamation of the constitution, scheduled for Dec. 25, to decide whether to dissolve the constituent parliament that produced the constitutional draft and hold new general electionx or to seek reinvestiture as premier. With 164 deputies, his party is 12 votes short of a majority in the 350-member lower house.

There has been some talk of a coalition with the Socialists. But Socialist leaders increasingly insist that, having cooperated in the consensus politics that wrote what it known here as the "constitution of concord," it is time for their party to go back into the opposition. The Socialists have 118 deputies.

Both the Socialist rank and file and major business leaders on the right have shown that they are tired of the "consensus" and want a left-right clarification of political life.

"Now we've done the easy part of the transition," said a high official, typical of the men in their late 30s and early 40s around Suarez. He was referring to the need to put flesh on the constitutional skeleton with laws that have high potential for political explosiveness.

Heading the list of possible legislative crises in the debate over regional autonomy. Most authorities speak of at least two to three years' parliamentary work to pass the 50 or more basic laws needed to implement the constitution.

Finding revenues to finance the new democratic institutions is also going to be a major problem for an already fragile economy. The new constitution calls for the establishment of a solid public school system alongside the parochial schools that are the main providers of quality educations in Spain. That item alone, probably the most costly, is expected to cost billions of dollars. CAPTION: Picture, King Juan Carlos, accompanied by Queen Sofia, Presents rote to Madrid poll attendant in yesterday's referendum. AP