CIA conducted operations to build popular support to go against Somoza

On December 1, Reagan signed a finding that authorized the CIA to “support and conduct paramilitary operations against the Cuban presence and Cuban-Sandinista support infrastructure in Nicaragua and elsewhere in Central America.” The agency would “work with foreign governments, organizations, and individuals to build popular support that will be nationalistic, anti-Cuban and anti-Somoza.”
(Source:Armony, Ariel C. "Argentina, the United States, and the Anti-Communist Crusade in Central America, 1977–1984 (Athens: Ohio University Center for International Studies, 1997), p.61)

I don’t understand why the operations were to be “anti-Somoza.” I thought the U.S. supported Somoza to fight Sandinistas in Nicaragua during the Soviet communism expansion in Central America in the late 1970s and early 1980s.

Anastasio Somoza was assassinated in exile in Paraguay by the Sandinistas in 1980. The anti-Sandinista Contas consisted largely of three distinct groups

The Contras were not a monolithic group, but a combination of three distinct elements of Nicaraguan society:[12]

  • Ex-guardsmen of the Nicaraguan National Guard and other right-wing figures who had fought for Nicaragua’s ex-dictator Somoza[12]—these later were especially found in the military wing of the Nicaraguan Democratic Force (FDN).[13] Remnants of the Guard later formed groups such as the Fifteenth of September Legion, the Anti-Sandinista Guerrilla Special Forces, and the National Army of Liberation.[citation needed] Initially however, these groups were small and conducted little active raiding into Nicaragua.[14]
  • Anti-Somozistas who had supported the revolution but felt betrayed by the Sandinista government[12] – e.g. Edgar Chamorro, prominent member of the political directorate of the FDN,[15] or Jose Francisco Cardenal, who had briefly served in the Council of State before leaving Nicaragua out of disagreement with the Sandinista government’s policies and founding the Nicaraguan Democratic Union (UDN), an opposition group of Nicaraguan exiles in Miami.[16] Another example are the MILPAS (Milicias Populares Anti-Sandinistas), peasant militias led by disillusioned Sandinista veterans from the northern mountains. Founded by Pedro Joaquín González (known as “Dimas”), the Milpistas were also known as chilotes (green corn). Even after his death, other MILPAS bands sprouted during 1980–1981. The Milpistas were composed largely of campesino (peasant) highlanders and rural workers.[17][18][19][20]
  • Nicaraguans who had avoided direct involvement in the revolution but opposed the Sandinistas

The CIA worked to merge them into a single united opposition:

The CIA and Argentine intelligence, seeking to unify the anti-Sandinista cause before initiating large-scale aid, persuaded 15 September Legion, the UDN and several former smaller groups to merge in September 1981 as the Nicaraguan Democratic Force (Fuerza Democrática Nicaragüense , FDN).[21] Although the FDN had its roots in two groups made up of former National Guardsmen (of the Somoza regime), its joint political directorate was led by businessman and former anti-Somoza activist Adolfo Calero Portocarrero.[22] Edgar Chamorro later stated that there was strong opposition within the UDN against working with the Guardsmen and that the merging only took place because of insistence by the CIA.

U.S. officials were active in attempting to unite the Contra groups. In June 1985 most of the groups reorganized as the United Nicaraguan Opposition (UNO), under the leadership of Adolfo Calero, Arturo Cruz and Alfonso Robelo, all originally supporters of the anti-Somoza revolution. After UNO’s dissolution early in 1987, the Nicaraguan Resistance (RN) was organized along similar lines in May.

Thank you very much. But why did the author mention only “anti-Somozistas” and leave out the other two?

Somoza was dead, his rule had been too vicious and too unpopular both in Nicaragua and in the US to be palatable to be officially backed by the US, even under Reagan, and even if part of the Contras was formed from the former Somoza National Guard. That they formed part of the Contras was something to be downplayed, not something to be endorsed. US military aid to Somoza was ended in 1978, when he fled Nicaragua in 1979, he flew to Miami, Florida but was denied asylum in the US, which is why he went to Paraguay where he was assassinated in 1980.

Somoza was buried in Miami, but from the wiki article on his assassination:

Somoza’s funeral attracted numerous wealthy Nicaraguan and Cuban exiles in South Florida, who protested the left-wing governments of Nicaragua, led by the Sandinista National Liberation Front, and Cuba, led by the Communist Party of Cuba. But some commentators noted that the exiles in Miami were also relieved at Somoza’s death. The newly founded Contra army, which consisted of many ex-members of Somoza’s National Guard, would have had to give the impression of having no relation to the old Somoza regime, for purposes of public relations and world opinion.

The Somoza National Guard was responsible for a laundry list of human rights violations, especially in the last two years of the regime, including widespread murder, torture, rape, and extortion. To give an idea on their activities and connection with the Somoza family,

Even as trusted friends of the family succeeded Luis in the presidency, his brother [Anastasio] remained firmly in control of the National Guard. Eventually, in 1967, Anastasio himself was elected president; Luis soon died of a heart attack, leaving Anastasio in sole control. Without his brother’s technocratic influence, Anastasio’s corrupt ways were unrestrained. The 1972 Nicaragua earthquake, which severely damaged the capital of Managua, brought further evidence of corruption, as members of the National Guard openly looted damaged businesses and misappropriated international aid,[5] and Somoza Debayle’s personal wealth soared during the reconstruction period. In 1974, the growing Sandinista movement FSLN (named after the assassinated Sandino) succeeded in forcing the government to accept an amnesty, after which Somoza Debayle declared a state of siege and the National Guard launched a violent and repressive reaction in the period 1975–76.[5] Though the FSLN was weakened, so was the regime.

Thank you very much, Dissonance.