Who wouldn't want to be an American ambassador?

Beyond the pomp and social cachet, you get a luxury residence, six-figure salary and private school tuition for your children — a comfortable diplomatic lifestyle bankrolled by taxpayers. For decades, presidents from both parties have quietly distributed a portion of these cushy posts (often in the touristy capitals of Europe and the Caribbean) to some of their most generous campaign donors. Although the practice is technically prohibited by law, Congress has long acquiesced.

"We're the only country in the world that does business in this way," says Dennis Jett, a retired ambassador, career foreign service officer and professor who wrote the book "American Ambassadors." "Nobody else has an open market on ambassadorships. If we really believed in capitalism, we would list these postings on eBay."

The problem, as indicated by Gordon Sondland and other donor-ambassadors during the Trump administration, is that the most loyal are often the least competent. But the practice of effectively selling ambassadorships did not start with President Donald Trump. The fact that nearly every modern president has done the same would seem to be the rare piece of evidence in support of Trump's claim that he is no more corrupt than the Washington "swamp." The incoming Biden administration now has a chance to prove him wrong.

The precise origins of ambassadorial graft are obscure, but one of the earliest examples can be found inside the original "smoke-filled room," a suite at the Blackstone Hotel in Chicago, where Republican power brokers haggled into the early hours of June 12, 1920, trying to choose an agreeable presidential candidate to unite their party's deadlocked convention. They finally settled on the stately-looking junior senator from Ohio, Warren G. Harding. One of Harding's powerful backers was George Harvey, publisher and industrialist, who had engineered Woodrow Wilson's ascent to the White House. After Harding won the election, he made Harvey ambassador to the Court of St. James in London.

Ambassador Harvey wasted no time in making a fool of himself. He showed up dressed like a minister from the previous century, in satin knee breeches and silver-buckled slippers. He gave a speech at a London club questioning whether women had souls. In another speech, delivered before the Pilgrims Society, he claimed that the U.S. had fought in World War I "reluctantly and laggardly" to save its own skin. Almost immediately, Harvey was condemned on both sides of the Atlantic. Harding distanced himself from his ambassador's views.

In 1924, Congress passed the Rogers Act, an attempt to create a corps of professional career diplomats. But the temptation to reward political allies with ambassadorships has only grown.

Sondland, a hotelier who gave a million dollars to Trump's inaugural committee, was made the U.S. ambassador to the European Union. Unlike Harvey, who had real clout, Sondland was mainly distinguished by his willingness to give away his own money.

As ambassador, Sondland undermined his State Department colleagues by serving as a back channel during Trump's attempted shakedown of the Ukrainian government. He was also overheard conducting a sensitive conversation with the president on his personal cellphone in a Kiev restaurant, a security breach that a former CIA official called "insane."

Under Presidents Bill Clinton, Barack Obama, George H.W. Bush and George W. Bush, roughly 70% of ambassadorial posts went to Foreign Service Officers — professionals who spent years training for such a post. The other 30% have been political appointments. Some of those are competent foreign-policy veterans; others have country expertise from working in business or the nonprofit sector; still others are chiefly qualified by their willingness to pour money into their patron's political campaign. Under Trump, the number of political appointments rose to 43%.

President Jimmy Carter had attempted to reform the system, promising a merit-based process overseen by a bipartisan screening board, and Congress made another attempt to limit political appointments with the Foreign Service Act of 1980. But the pay-for-play system continued, spurred on by campaign costs and the aspirations of the wealthy.

President-elect Joe Biden, who had a clear view of this system as the top Democrat on the Senate Foreign Relations Committee for many years, now has a chance to reform it. It is unclear whether he will.

While his primary opponent Sen. Elizabeth Warren vowed that no ambassadorial posts would go to donors or bundlers, Biden demurred when asked about the issue earlier this month, saying only that he would "appoint the best people possible." Sen. Tim Kaine, a Democrat from Virginia, has sponsored a bill that would require would-be ambassadors to disclose their country knowledge and language skills in detail, along with any political contributions given or bundled over the previous 10 years.

Ambassadors are responsible for hundreds of government employees and have a hand in most every aspect of American policy within the borders of their host nation. "Would you want a campaign contributor to be the captain of an aircraft carrier?" asked Jett. "Obviously not. This is a national security issue."

Beyond the inherent risk of giving such a sensitive job to anyone but the most competent candidate, the practice of nominating donors demoralizes the Foreign Service, wastes opportunities to develop future leaders and presents the world with a cynical face. It is an especially dangerous practice when Trump has been working to reframe foreign policy as a more contingent set of arrangements where there are no permanent bonds, only interests.

Perhaps there was once a time when American alliances were strong enough to withstand a few Sondlands, but that is far less true today than it was four years ago. If Biden is serious about restoring America's standing in the world, he should entrust that task to professionals.

Mattathias Schwartz is a contributing writer for the New York Times Magazine. He is also a contributing editor for Rest of World and a former staff writer at the New Yorker, where he won the Livingston Award for international reporting. He wrote this article for the New York Times.