The surprise requirement that Rupert Murdoch sell either his newspapers or television stations in Boston and New York was a response to the Federal Communications Commission's sudden revocation of the "Fairness Doctrine" last August, according to two key Democrats.

Rep. Neal Smith (D-Iowa) said yesterday that, because the FCC voted out the doctrine requiring broadcasters to cover important public issues and give opposing points of view, some legislators felt that the agency's prohibition on cross-ownership also was in jeopardy.

That rule forbids ownership of a daily newspaper and a broadcast outlet in the same market.

"The FCC doesn't have any trust on the hill," said Smith, chairman of the subcommittee that approved the new requirement as part of the omnibus spending bill. "We feel like they went overboard in something that was, in effect, a change of law," he added, referring to the Fairness Doctrine decision.

Scrapping the doctrine surprised many members of Congress who said they believed that the FCC would submit several options before revising the rule.

Broadcasters argue that the doctrine is outdated because many alternative networks are available to viewers. Many legislators and community groups have argued that, without it, television station owners would make little or no time for less profitable public-service programs.

With President Reagan threatening to veto the spending package if the doctrine were restored through a last-minute amendment, Smith and Democratic Sens. Ernest F. Hollings (S.C.) and Edward M. Kennedy (Mass.) took aim elsewhere, adding language that would keep the FCC from changing its 14-year "cross-ownership" rule.

"The signals were abundantly clear that history was about to repeat itself," Kennedy said yesterday in Lexington, Mass. "Congress had been burned once by the FCC, and Sen. Hollings and I were not about to be burned again. So we took the only practical step available to us."

If the new legislation is not rescinded, Murdoch must sell either the Boston Herald or WFXT-TV in Boston and either the New York Post or WNYW-TV there. Both stations are part of Fox Broadcasting Co., which Murdoch owns.

After Murdoch bought television stations in New York, Chicago and Boston, he requested and received temporary FCC waivers from the cross-ownership rule. Murdoch, who sold the Chicago Sun-Times to a former business associate, has until March 6 to sell a New York property and until June 30 to sell one in Boston.

Although Murdoch's company has put together a prospectus on the New York Post and provides it to any prospective buyer who signs a confidentiality agreement, Patrick Purcell, president and publisher of the Herald and the Post, said yesterday that Murdoch has not "decided really whether to retain the TV station or the Herald."

Purcell said the Herald, a money loser when Murdoch purchased it, has made a profit in the last two years.

The last-minute Kennedy-Hollings' maneuver has prompted much controversy, and New York Sens. Alfonse M. D'Amato (R) and Daniel Patrick Moynihan (D) have said they want to introduce a measure returning the issue to the FCC.

The Boston Herald, rarely shy about its views, yesterday featured a front-page editorial headlined: "Kennedy's Vendetta."

Although Kennedy was "quick to trumpet his deep affection for the First Amendment," the Herald said, "he would not hesitate for a moment to prefer a friendly newspaper. Nor would he hesitate to undo a critical one."

The Herald has been critical of Kennedy, with columnist Howie Carr repeatedly referring to him as "Fat Boy" and "the nation's oldest juvenile delinquent."

The Boston Globe, whose columnist Mike Barnicle has made similar observations about Kennedy, reported yesterday that Kennedy's bad feelings about the Herald date to his 1980 campaign against President Jimmy Carter for the presidential nomination.

The Herald wrote then at length about the death in July 1969 of Mary Jo Kopechne, a passenger in a car that was driven by Kennedy and plunged off a bridge in Chappaquiddick, Mass. During the campaign against Carter, Kennedy's office said no comment would be made on stories "printed in one of the least credible newspapers in the country."

Kennedy said yesterday that, under "antimonopoly and anticoncentration laws," Murdoch "can keep his newspaper, or he can keep his broadcasting station. But he can't keep them both."

Instead of attacking him, Kennedy said, the Herald "should try to explain why they think they're entitled to an exemption from the antitrust laws."

At the request of the Freedom of Expression Foundation, funded by ost of the nation's major publishers and broadcasters, including Murdoch, the FCC has begun reviewing the cross-ownership rule to see whether it promotes variety of ownership or accelerates the decline and closing of newspapers, as the publishers and broadcasters argue.

Purcell said that, if WFXT-TV were not so profitable, losses at the Herald would have been impossible to bear. "No one else would have bought it, no one else in the country wanted to take up the challenge of competing with The Boston Globe," he said.