It’s been another bad week for government. Another budget impasse. More embarrassing revelations about the federal loan guarantee for a failed solar energy company. And, of course, those $16 muffins.

Don’t you wish government could get its act together and perform with the efficiency and competence of the private sector?

Hewlett-Packard, for example. It’s hard to imagine how, in the space of a decade, a group of executives and directors managed to take one of the world’s most respected and profitable companies, the very heart and soul of Silicon Valley’s innovation culture, and turn it into a real-life corporate soap opera, complete with sex, revenge, betrayal, behind-the-scenes back-stabbing, press leaks, illegal snooping and dynastic intrigue.

A decade ago, when HP’s hot new chief executive, Carly Fiorina, announced the purchase of Compaq Computer, Hewlett’s shares traded at $23. Today, after Internet growth literally exploded around the world and other tech firms’ values have soared, HP shares sell for $22, and the company has become a business school case study in inept corporate governance.

In just the past five months, HP managed to destroy $60 billion in market value for long-term shareholders. Nothing the Department of Energy has done regarding solar loan guarantees even comes close to that.

HP’s troubles began when heirs to founders Bill Hewlett and Dave Packard, along with longtime board members, started to wonder whether Fiorina’s management style was undermining the company’s famously laid-back and innovative culture. A nasty proxy battle for control of the company led to Fiorina’s departure but failed to heal the division on the board. Continuing squabbles and press leaks led to an ill-fated investigation involving purloined phone records of directors and journalists and the noisy departure of several board members.

The new chief executive, Mark Hurd, survived that scandal, but not the one involving the former soft-porn star and reality TV contestant whom he had hired as a corporate event planner. While allowing Hurd to walk away with a $35 million severance package, the board somehow failed to negotiate a noncompete agreement that would have prevented him from taking his inside knowledge to arch-rival Oracle, where he is now a top executive.

After a hurried search, the beleaguered board named Leo Apothekar as its newest chief executive, a Frenchman who had been eased out of the top job at the German software giant SAP and had no experience in the computer hardware business that provides HP with the majority of its sales and profits. This summer, Apothekar—with the board’s backing—announced a grand new strategy for HP that included moving out of low-margin personal computers, scrapping development of a tablet to compete with Apple’s iPad and buying for an inflated price a British software company nobody had ever heard of.

The reaction from customers, shareholders and employees was so negative that the company tried to walk it back, but not before directors had begun to lose confidence in their insular and sometimes arrogant chief executive.

Last week, before completing his first year on the job, Apotheker was unceremoniously sent packing with a severance package valued at $10 million to $12 million, which even in Washington would buy him a lot of muffins.

Some of the best reporting about this latest chapter in the HP saga came from New York Times columnist James Stewart, who uncovered the embarrassing fact that only four members of the HP board had bothered to meet and talk with Apotheker before he was named chief executive.

“I admit it was highly unusual,” one board member who hadn’t met Apotheker told Stewart. “But we were just too exhausted from all the infighting.”

Who needs Sarbanes-Oxley when we have corporate boards like this?

The person appointed last week to replace Apotheker is former eBay chief executive Meg Whitman, whose recent claim to fame is that, in her unsuccessful campaign for governor of California last year, she wound up paying $50 for each vote she received in the final election on top of the $88 she spent for each primary vote.

With the election behind her, Whitman was one of five new directors appointed to the HP board this year. According to the shareholder advisory firm ISS, which criticized the process, Apotheker was actively involved in recruiting the new directors who would be his boss in a process that largely bypassed the board’s nominations and governance committee. So it was perhaps no coincidence that when those five new directors were announced in March, they included another Frenchman, Dominique Senequier, with whom Apotheker had served on two corporate boards, and three former corporate customers of SAP, eBay’s Whitman among them.

Several weeks later, Whitman’s appointment was rubber-stamped by shareholders at HP’s annual meeting in one of those sham, Soviet-style “elections” in which there are no other candidates (spending per vote: $0). And within a week, Whitman also got the good news that she had been hired as a part-time strategic adviser at the venture capital firm of Kleiner Perkins Caufield & Byers, where HP board chairman Ray Lane just happens to be a partner. Small world.

By his own admission, it was Lane who secretly engineered Whitman’s appointment as chief executive without putting the board or the company through the time and expense of conducting a proper search or seriously considering other candidates. And you may be surprised to learn that one of Whitman’s conditions for taking the job was that Lane be more involved in the strategic direction of the company by taking the expanded title of “executive chairman.”

The last time we’ve seen anything quite so cozy was when Dick Cheney headed up the vice presidential search process for George W. Bush and concluded the best man for the job was . . . Dick Cheney.

I have no idea whether Meg Whitman will be able to turn things around at Hewlett-Packard. But the manner of her selection, both as a director and chief executive, is a pretty good indication that the HP board has learned very little from the embarrassing and costly screw-ups of the past decade.

And it is a reminder that costly and embarrassing scandals, like those involving $16 muffins and soured $500 million loan guarantees, are hardly limited to the public sector.