The Roman Catholic bishops of the United States wound up their four-day annual meeting here yesterday with a blast at Catholic theologians who last October declared in a full-page newspaper advertisement that faithful Catholics might hold "a diversity of opinions" on abortion.

Archbishop John Quinn of San Francisco, head of the bishops' committee on doctrine, charged that the ad hoc group of theologians had presented "a personal opinion which directly contradicts the clear and constant teaching of the church about abortion . . . which they as Catholics are obliged to accept."

The advertisement, which was signed by nearly 100 scholars, nuns and priests, asserted that "a diversity of opinions regarding abortion exists among committed Catholics" and called for "candid and respectful discussion."

Quinn said yesterday that "such an opinion, however sincerely motivated, contradicts the clear and constant teaching of the church that deliberately chosen abortion is objectively immoral. It is not a legitimate moral choice."

The fact that the bishops felt obliged to respond to the advertisement, coordinated by a group called Catholic Committee on Pluralism and Abortion, reflects the sensitivity of the abortion issue, since the bishops rarely respond as a national body to unofficial Catholic groups.

When asked about the move, Bishop James W. Malone of Youngstown, Ohio, president of the bishops' conference, said the ad "purported to give a different theological interpretation to our stand."

In the wake of widespread attention to the first draft of the bishop's proposed pastoral letter on the economy, Auxiliary Bishop Joseph A. Francis of Newark deplored the inattention given an earlier pastoral letter on the problem of racism.

On the fifth anniversary of that document, said Francis, who is black, the pastoral on racism remains "the best-kept secret in the U.S. church." He said the central message of that pastoral is that "racism is a sin and racism is a reality in our country and within our church," and challenged the bishops to make the pastoral's message a reality.

Archbishop Ernest L. Unterkoefler of Charleston, S.C., added that "in recent months, racism has gotten a new dynamism," as demonstrated by "certain political facts in the South."

The concerns about racism, as well as a proposal by New York Auxiliary Bishop Emerson J. Moore that the conference consider "divestiture of church funds" from institutions that profit from apartheid in South Africa, were referred to a standing committee for further study and action.

The bishops agreed to a nationwide study of attendance at masses, requested by Cincinnati Archbishop Daniel E. Pilarczyk, who said such studies there reflect a 20 percent decline over the last two decades.

"If Cincinnati is the only diocese experiencing such a phenomenon, then I have a problem. If other dioceses are experiencing this, then we all have a problem . . . and we ought to find out why and what can be done about it," he said.

In Cincinnati at present, he said, about 50 percent of Catholics attend mass on a given Sunday.

In the closing hours, Malone read a message from the Vatican, saying that Pope John Paul II commended the American bishops' launching of the economics pastoral and "your efforts in furthering the cause of human dignity and world peace."

In a final summing up of the meeting for the press, Malone said he believes the economics pastoral is "off to a good beginning. The bishops, judging by their comments, feel that it is on the right track. They are going to be doing a great deal in their dioceses to strengthen and improve it."

The pastoral, which calls for private and public efforts to reduce the numbers of unemployed and the 35 million Americans living below the poverty line, is expected to be revised twice before being presented for final approval next year.