Italy's four-party coalition government collapsed today in the midst of a burgeoning scandal involving accusations of illegal and even subversive activities by a Masonic lodge to which key government, military and establishment figures allegedly belonged.

The lodge was said to have become "a center of secret power" in Italy. According to a report by investigating magistrates in Milan, it "combined business and politics with the intention of destroying the constitutional order of the country."

The scandal, the most farreaching in Italy's postwar history, broke Thursday when Premier Arnaldo Forlani, on the advice of the investigating magistrates, made public a list of 953 names of reported members of the lodge. The list included two Cabinet members, top businessmen, publishers, diplomats and military officers.

Publication of the list of alleged lodge members deeply shook Forlani's seven-month old government, the 40th in Italy since World War II. Justice Minister Adolfo Sarti, whose name was linked to the lodge in papers found at fugitive grand master Licio Gelli's house, resigned Saturday. Two other Cabinet ministers named on the list refused to do so.

Most of the people on the list have denied membership in the lodge.

Gelli is under investigation for a series of illicit dealings, including political espionage and an alleged role in the faked kidnapping from New York in 1979 of Sicilian financier Michele Sindona. A parliamentary committee investigating the case, which has simmered for months, has charged that the lodge was involved in a plot to set up an authoritarian government in Italy as well as bribes and tax evasion in the oil industry.

Prosecutors have singled out Gelli's lodge, Propaganda Due, or P2, as a "secret-sect" suspect because of the allegations that Gelli led it into political intrigue. The Italian constitution bans secret associations and membership in them is outlawed.

The Masons, who in decades past were banned by the Italian government have existed openly in Italy since World War II. Italy's Grand Orient Lodge, with about 526 branches and 20,000 members, is located a block away from Christian Democratic Party headquarters here.

The immediate cause behind the fall of the Christian Democratic-led government was yesterday's refusal by the Socialist Paty to participate in a meeting to replace the ministers allegedly involved in the scandal.

The Socialists control 62 votes in parliament, a hefty chunk of the coalition's parliamentary majority, and their decision to boycott yesterday's meeting was read by Forlani as a withdrawal of political confidence.

With important local elections less than a month away, the Socialist leader, Bettino Craxi, is said to have been angered by what he saw as the Christian Democratic Party's attempt to ride a moralistic horse by calling for the resignation of those mentioned in the scandal. He also is said to have been annoyed by the broadside attacks on the Masonic movement by Christian Democratic party leader Flaminio Piccoli.

The Socialists, who have called for a clarification of coalition policy for months, clearly decided to seize the opportunity presented by what has become known as the P2 scandal.

Quite apart from the scandal, however, the Forlani government has been beset by fierce political infighting since its formation in October 1980. Often deserted by its own supporters, it frequently was defeated in parliament and forced to use votes of confidence for the approval of ordinary measures.

In part, this was due to outside events: a major oil tax scandal late last fall, the massive winter earthquake in the Italian south, and the strains of the end-of-year Red Brigades kidnapping of Rome magistrate Giovanni d'Urso.

But the coalition of Christian Democrats, Socialists, Republicans and Social Democrats has been sharply divided over economic and social policy as well as over relations with the powerful Italian Communists. To further complicate the situation, most of these parties are themselves crippled by deep internal splits.

Following Forlani's resignation today, Italy's 84-year-old Socialist President Sandro Pertini began constitutionally required political consultations. When they are finished, he is expected to ask Forlani to try and form another government.

But formation of a new government is not likely to be easy. The Christian Democrats are known to favor a new version of the outgoing coalition, perhaps extended to include the small, somewhat right-of-center Liberals.

The Socialists and the small Republican Party, for their part, are demanding basic changes in the government's program. The Socialists' chief parliamentary whip, Silvano Labriola, said yesterday his party wants "a profound change that permits total renewal." His remarks led political observers to speculate that Craxi will use the opportunity to renew his bid to become the first non-Christian, democratic premier since the birth of the Italian republic in 1948.

Although the Socialists control only 9.8 percent of the vote compared to the 38 percent won by the Christian Democrats in the 1979 national elections, the prospect of a Socialist premier might be accepted by some of Italy's smaller parties.

But there is little doubt that the Christian Democrats would fight tooth and nail to hold on to the office, even at the cost of dissolving parliament and calling a national vote.

Some observers here have pointed out that next month's local elections could provide a political explanation why the P2 scandal has erupted to such a degree at this time.

Others also target the Italian fascination with intrigue and conspiracies, the notion in political and media circles that someone has been pulling the strings from behind the scenes.