Five top officials of Italy's armed forces and secret services implicated in a scandal involving a covert Masonic lodge have gone on leave pending an investigation of the case by a government commission.

The latest repercussion from the scandal that on Tuesday caused the collapse of the government led by Christian Democrat Arnaldo Forlani came last night when Adm. Giovanni Torrisi, head of the joint chiefs of staff, announced he was voluntarily going on leave "to facilitate the steps in progress to unequivocally clear up the situation."

The statement by the admiral, who was appointed in January 1980, was followed by an announcement that the same decision had been made by Gen. Giuseppe Santovito, head of the military secret service; Gen. Giulio Grassini, head of the domestic secret service; Gen Orazio Giannini, commander of the customs police, and Walter Pelosi, director of the secret service coordinating body. All denied any wrongdoing.

The names of Torrisi, the highest officer in the Italian armed forces, and those of the four other officials had been included in a list of 962 names of alleged members of a renegade Masonic lodge, known as P2, or Propaganda Two. The lodge's fugitive grand master, Lico Gelli, left Italy in March and is wanted on charges of political esapionage.

The list's release last week provoked a government crisis that is expected to prove difficult to resolve and that could lead to early elections even though President Sandro Pertini opposes dissolution of parliament before its due date in 1984.

Pertini today asked Arnaldo Forlani, who has stayed on as caretaker premier, to try to form another government.

Forlani, who will begin political negotiations on Monday, may find it difficult to overcome sharp differences with his former Socialist partners, the second largest group in the outgoing four-party coalition.

Along with a political crisis, the publication of the list also appears likely to cause tremors among civil servants and other public officials, politicians and possibly journalists.

Today, magistrates here decided that a related investigation regarding kickbacks deriving from a 1979 oil deal with Saudi Arabia would be turned over to a parliamentary commission because papers found among Gelli's documents intimated that some former Cabinet ministers might be implicated.

But a top Rome magistrate involved in the Gelli investigation repeated that so far charges had been made only against Gelli and a former secret service officer, Col. Antonio Viezzer. For now, he said, only three aides to a former Christian Democratic foreign trade official had been told, for their own protection, that they were under investigation. Membership alone in the P2 lodge, he added, was not a crime and therefore was "of no interest to the Italian state."

Nevertheless, the taint of possible involvement with the lodge, or with Gelli, has led many Italians to call for a purge.

In the case of the top military and secret service officials, forbidden by law from belonging to any secret organization, the initial attitude of Socialist Defense Minister Lelio Lagorio was that of confidence in the word of a senior officer until concrete evidence of involvement with Gelli was provided.

A Defense Ministry spokesman pointed out that the officers' decision to go on temporary leave was voluntary and that "no punitive sanctions have been adopted in their regards."

But the officers are certain to have come under sharp pressure. Italian newspapers reported today and yesterday that the government was considering suspending the security clearance for those officers who might participate in NATO meetings and this is thought to have persuaded them to make a voluntary exit.

The shakeup in the high military and secret service echelons was not expected to have any significant effect on Italy's defense capability.

A Western diplomat who deals with military matters yesterday pointed out that no other Italian chiefs of staff nor the military's top policy-planning officers have been implicated.

Nevertheless, there is little doubt that this will damage the military's image here.

Both the Defense Ministry and the presidential palace are said to have already quietly demoted several top civi servants whose names were on the list and the same is expected to happen at the Interior Ministry and elsewhere. There have been calls for the removal of all state television officials whose names were listed and one has already resigned.

Many journalists at the Milan daily Corriere della Sera are angry because the editor, the publisher and the general manager of the paper are all on the list. The Christian Democratic Party, declaring Masonic and party membership to be incompatible, has temporarily suspended all 15 Christian Democratic members of parliament included on the list.

"Since it is impossible to prove one's nonmembership, this is terribly unfair," said Christian Democratic Deputy Massimo de Carolis, who says although he met Geli three times he was never even asked to become a P2 member.

He asked why so much credibility was being given to a list made up by a man who had been charged with criminal activities. "This is a dangerous precedent," he said. "It means that if a top bank robber issued a list of corrupt policemen everyone would simply believe it."

In contrast, the Superior Council of the Magistrature, Italy's highest judicial body, has said no action will be taken against the 19 judges on Gelli's list until after an investigation.