Legislation approved by the Spanish parliament reintroducing divorce here after a ban of more than 40 years threatens to split the ruling centrist party and exacerbate tension between the church and the state.

As many as 500,000 Spaniards whose mariiages are broken are expected to file for divorce, according to some estimates, when the law passed last night goes into effect, perhaps by the middle of next month. Divorce was banned by the dictatorship of the late dictator, Gen. Francisco Franco. Spaniards who wanted to separate and remarry had to apply for lengthy and costly annulments from the Roman Catholic Church.

The Madrid newspaper Ya. which is strongly identified with the Catholic heirarchy and has sister publications in several provincial cities, warned in an editorial today that the divorce legislation would produce "an immediate social tremor, destroying families where the cracks are showing and introducing cracks into families that are solidly united."

Justice Ministry sources said they expected strong vocal protests from Catholic sectors in the immediate aftermath of the legislation. But once the novelty has worn off, the sources said, the existence of divorce will be accepted by Catholics and non-Catholics alike as part of the modernity of post-Franco Spain.

The legislation was strongly opposed by church spokesmen and last-minute parliamentary maneuvering to remove one of its more conservative provisions has deeply divided the governing party into liberal and conservative camps.

The bulk of the legislation, introduced by the ruling Union of the Democratic Center party, had been agreed by consensus with the opposition Social Party. The bill allows uncontested divorces suits to be settled within two years of filing for separation and delays of up to five years for contested suits.

Conservatives added a provision last week to give judges discretionary power to delay uncontested suits for up to seven years if children are involved. That provision was removed in a last-minute amendment sponsored by the opposition and passed in a secret ballot with the support of about 40 ruling party congressmen.

The liberalizing maneuver came last night when the bill was given its final reading in Congress. Socialist speakers in the debate argued that Spanish judges were ideologically conservative and would abuse such powers. The amendment passed 162 to 128, indicating that as many as 40 Union of the Christian Center legislators had supported the measure, ignoring party directives. The Union has 165 members in Congress, and one the discretionary powers amendment the party counted on support from conservative and regionalist parties.

Deeply angered conservatives in the Christian Democratic wing of the party threatened to engineer the expulsion of the liberals at a Union executive committee meeting scheduled for later this week and to realign the centrist party towards the right.

The chief target of conservative criticism was Justice Minister Francisco Fernandez Ordonex, who has been the foremost defender of the new legislation on the government bench. An influential Christian Democratic legislator, Oscar Alzaga, who had defended a more restrictive divorce bill, termed the legislation approved by parliament as "defrauding our electorate" and said he would seek Fernandez Ordonez' resignation.

The minister has already earned himself the opposition of the powerful Roman Catholic hierarchy. Last week in an unprecedented expression of hostility over the divorce issue, the archbishop of Toledo, who is the primate of Spain, refused to allow Fernandez Ordonex to take part in the city's Corpus Christi procession which is traditionally presided over by the primate and the justice minister.

Behind the bitter internal row in the governing party is an ongoing power struggle between the two wings of the party over the political ground it should occupy. The Christian Democrats contend that the party should shift toward the right and regain the middle class, conservative Catholic vote that they view as increasingly disenchanted with Spain's democratic experiment.

The progressive wing, which is nominally headed by Fernandez Ordonez, argues that the party must maintain its lay, centrist image and electoral appeal.

A central contention in the debate is that unless the governing party presents a coherent conservative platform its credibility among a supposed silent majority vote will be eroded to the point that the democratic institutions themselves will be questioned. Sources close to Prime Minister Leopoldo Calvo-Sotelo, who took power after an abortive putsch attempt in February, say he is sterring a middle course in the feuding. But the premier was visibly angered by the divisions within the party during last night's congressional vote.

The Justice Ministry aims to have established 34 divorce courts by August to handle the rush of divorce cases. Procedural legislation still pending will clarify current gaps in the bill dealing with the family and alimony provisions.

In recent years Spanairds have become increasingly aware of divorce through the publicity given the church annulment proceedings initiated by popular figures such as top matador Paquirri and international crooner Julio Iglesias. The most celebrated of all society annulment proceedings concerns the separation of Franco's eldest granddaughter, Carmen, from her husband, the Duke of Cadiz, who is a cousin of King Juan Carlos.