The Roman Catholic Church, which used to play a formidable role in Spanish politics, has refused to take sides in Wednesday's parliamentary elections.

The basic position of the church is that when Catholics go to the polls they should make a "free choice" and "must not be afraid of democracy and the future." It has warned, however, against totalitarian ideologies of the left and of the right

Quite predictably a few bishops and priests have openly attacked Marxists, Communists and Socialists and defended the conservative Catholicism represented by the late dictator Francisco Franco.

But most of the hierarchy and regular clergy have adopted the neutral stand set by the church's leader, Madrid's liberal Vicente Cardinal Enrique Y. Tarancon.

"We don't want to be involved in the struggle for power," the cardinal said Sunday in his weekly letter. The decision to vote for a candidate and a party must be "personal," he said pointing out that even the church's leaders apeared divided but that politics has nothing to do with religion.

The church, which withdrew its support of Franco in the late 1960s and began a drive for civil rights and democracy, has been embarrrassed by the campaign activities of rightist and lefitst priests, however.

As part of a drive to divorce the church from politics, the bishops asked priests not to run for seats in the Chamber of Deputies of Senate in Spain's first free vote in 41 years. But at least 15 priest, mostly lefitst who were jailed and fined for opposing the Franco dictatorship, are candidates.

Bishops have decided to tolerate the political role of these leftists to demonstrate that the church is no longer on the side of privilege and of the state.

"We backed Franco in the Civil war and helped to strengthen the dictatorship," said an auxiliary bishop . "Now we must pay the price."

The hierarchy wants the new Parliament to write a new constitution that will finally separate the church from the state and guarantee religious freedom.

It still remains adamantly opposed to abortion, but several bishops have made it clear that the church will not oppose divorces among couples who marry without a religious ceremony.

"The church, like Spain, has changed," said a vicar. "We do not reflect the realities and tendecies of the society and we must adapt."