I would describe the US perspective on Panama prior to the invasion as benign neglect, except typically that phrase is not used to describe the kind of self-interested neglect practiced by Americans in the country. The clearest summary of this I’ve seen is in Michael Conniff’s Panama and the United States: The Forced Alliance. To summarize the summary:
The canal, a successful economic, political, and military asset for the United States, was a top priority and keeping everything around it quiet was the focus of the varying degrees and forms of aid sent to the country pre-Noriega.
As early as 1972, when Noriega ascended to prominence as the head of Panamanian military intelligence, he was pegged by the US drug enforcement leadership as a key figure in international drugs, up to and including the point where Nixon received advice that his “plumbers” should take him out. Nixon declined, and soon was in no position to take any such measures. (Conniff, 149-150)
Noriega, amid increasingly weak and less legitimate presidents including the allegedly stolen election of Ardito Barletta, becomes a key figure as both an intermediary of the Medellin drug cartel in Colombia and a key conduit for US support of the Nicaraguan Contras in the soon to be notorious Iran-Contra affair. This dual ascendance simultaneously made him deeply problematic and worthwhile as the Reagan administration worked towards increasing their extra-official, increasingly illegal (as per the narrow and confused Boland amendment) funding of the anti-Sandinista Contras in Nicaragua. Noriega did not rest on his laurels, and diversified into grand-scale money laundering, international passport sales to permit passage to the US and elsewhere of citizens of unfriendly nations, and generally circumventing US trade restrictions on weapons and technology. (Conniff 151-152) This did not appear to prevent the Reagan administration from embedding him further in their work with the Contras, which was after all a worldwide effort where such an entrepreneurial drive was presumably quite useful.
Curiously, it was the murder of an opposition leader, Hugo Spadafora, in Aug 1985 that catalyzed both a shift towards formal dictatorship in Panama and increasing international awareness of Noriega’s conduct. Spadafora had many liabilities in US eyes, not least of which was his erstwhile involvement with the Sandinistas, but he was in this case punished for saying out loud what was at this point well-known about Noriega’s drug activities. His decapitated, mutilated body drove intense pressure on (figurehead president) Barletta to announce an investigation; the Panamanian military infrastructure then had him resign as president when he complied demonstrating decisively where the power lay. (Conniff, 153)
By June 1986, the US had settled, somewhat reluctantly, upon support of Noriega under the rationale that he kept the peace, and this point of view was led by then Secretary of State Elliot Abrams. But that’s when the math changed: Congress authorized direct support to the Contras once again, via normal CIA channels, and thus Noriega was no longer as useful. Combined with Seymour Hersch’s exposes about Noriega in the New York Times, and US Senator Jesse Helms’ very public campaign of inquiries on Noriega, support had withered to elements in the CIA, Department of Defense, and the Drug Enforcement Administration even as the Reagan White House and others saw “doing something” about Noriega as increasingly inevitable. (Conniff, 156)
Noriega’s chief of staff resigned as an outcome of a power struggle with Noriega in June 1987. He then went public with his account of Noriega’s activities, including the diverse high-profile murders. This emboldened the opposition, and Noriega responded with violence and repression. As the US embassy began promoting elections to replace him, he used hired criminals to attack and interfere with the embassy and peripheral buildings themselves.
Ultimately, it worked. The US was unable to find someone in the defense establishment who wanted to take on Noriega and replace him, and he jailed or exiled anyone of note who opposed him. That’s where the situation still stood as George H.W. Bush took office, with a modest set of US sanctions (and reduction in aid); US companies merely had to pay a tax to continue operating in the country. Noriega held yet another extremely fraudulent election in 1989, coupled with tv news broadcasting repression of protesters internationally and near-universal international condemnation. Bush cut ties altogether and probably felt some need to make it a clear break on account of the impending announcement of his “war on drugs”. (Conniff, 161)
The US supported a coup. In late 1989 it occurred, failed, and Noriega executed the conspirators, sometimes personally. The increasingly high profile feud between Bush and Noriega was further escalated by the cyclical requirements for cooperation over the canal, where Noriega persisted in pushing forth clearly corrupt men for the jobs. Other assessments point to Bush’s alleged timidity in dealing with Chinese anti-democratic crackdowns and the escalating fall of communism in Eastern Europe, otherwise known as the wimp factor. (Conniff, 163). When American soldiers were shot at while driving by a Panamanian military post, leading to the death of one soldier, Operation Just Cause had the necessary spark to get moving.
Summary (level 3!) : The US had conflicted policy on Noriega, represented across factions in the different branches and agencies of the government, going back to his ascendance as a military intelligence leader. While undeniably corrupt, occasionally murderous, and immersed in diverse international-scale illegal activities, he maintained his usefulness as a source of stability (crucial for the Canal) and as a key factor in Iran-Contra. The US, as a result of the increasingly high profile of his misdeeds, tried a variety of forms of pressure and removal-by-proxy efforts in the country starting with the late Reagan administration and the first half of GHW Bush’s term, as he became more of a liability than an asset as a result of public scrutiny. Eventually, the international/domestic political climate around the Bush administration and chain of failures to remove him by other means came to a head with Panamian troops shooting at a passing US Army vehicle, killing one, and Bush opted for a show-of-force approach to settling the matter, splitting the difference between what seems like strong Panamanian public support and a negative international reaction to US military intervention.
What was “wrong” with Noriega? Ultimately, I would argue that he had a very canny sense of both what he could get away with and what would strengthen his hand domestically, but by the late 80s he was functioning in a Cold War mindset that was no longer applicable to assessing US priorities. When he gained ground in the many abortive efforts to remove him, he took it and built yet another corrupt, lucrative plank in his empire, when modest adaptation to the new climate could have well gotten him off the hook. George H. W. Bush, as a former head of the CIA, might have been viewed by him as someone who was too much of a “realist” to take him on or subject to the aforementioned “wimp factor”; both views ignored that invading a “beatable” enemy is a time-honored means of bolstering one’s credibility as a strong leader.