When Pvt. ​Travis T. King fled to North Korea in July, he looked like a potential propaganda bonanza for Kim Jong-un’s government.

He was the first American soldier to cross from South Korea into the North since 1982. The North Korean state media claimed that Private King, who is Black, had complained of racial discrimination in the Army and said he wanted asylum. All the U.S. soldiers who deserted to the North during the Cold War were welcomed and used for anti-American propaganda, a fate that seemed entirely possible for Private King.

But instead, North Korea deported him on Wednesday after weeks of diplomacy mediated by Sweden. American officials took custody of him in China and flew him to the United States.

The North has said little about its reasons for expelling Private King. But several experts on the isolated country said it boiled down to this: Times have changed, and North Korea is now more likely to see an American deserter as a burden than as a benefit, unless the defector is a high-profile person privy to secret information.

“Mr. King, to Pyongyang, is a low-value asset,” said Lee Sung-Yoon, a fellow with the Woodrow Wilson International Center for Scholars in Washington who has written a book about the North.

During the Cold War, American soldiers who defected to the North were allowed to settle there and start families. They became propaganda assets, domestically as well as internationally. North Korea was producing countless films meant to teach its people to fear and hate the United States, and ​the deserters came in handy for roles as American characters, usually evil ones.

But while the North still makes such movies, its nuclear arsenal has become a vastly more important domestic propaganda tool for Mr. Kim, said Cheong Seong-chang, a longtime North Korea analyst at the Sejong Institute, a South Korean think tank.

“Kim Jong-un’s nuclear weapons have become the most effective means for him to elicit the loyalty of his people, ​as he told them that their country has become a nuclear power that the United States cannot mess with,” Mr. Cheong said.

Some American ​civilians detained by North Korea have been used as bargaining chips with Washington, released only when prominent figures like former Presidents Bill Clinton and Jimmy Carter ​visited Pyongyang, the capital. But Mr. Kim has shown little interest in restarting talks with the United States since his direct diplomacy with President Donald J. Trump​ collapsed in 2019.

And North Korea has learned that detaining Americans can backfire, from a propaganda perspective. It found itself in an ignoble global spotlight after the death of Otto F. Warmbier, a University of Virginia student, in 2017. ​Mr. Warmbier, who had visited the North as a tourist, was held there ​for 17 months on charges of stealing a propaganda poster. When released to American officials, he was in a coma, and he died soon afterward.

“Kim Jong-un may have wondered, ‘What’s the use of keeping ​an American soldier?​’​” Mr. Cheong said. “It was not as if ​Private King came over with a​ load of valuable information on the U.S. military with him.”

Nor is there any indication, even from the North’s dubious state media accounts, that Private King had praised the country’s political system. His reasons for crossing into the North, at the border village of Panmunjom in the Demilitarized Zone that divides the Koreas, remain unclear.

Private King had spent time in a South Korean jail on assault charges, and U.S. military personnel had escorted him to Incheon International Airport near Seoul. He was supposed to board a plane to Texas to face further disciplinary action from the military, but instead he left the airport and made his way to Panmunjom.

“North Korea is sensitive about how the rest of the world sees its human rights condition​,” ​said Hong Min, a​n analyst at the Korea Institute for National Unification in Seoul. “It may have wanted to prove that it was not an abnormal country by treating Private King’s case in a ‘gentlemanly manner’ and showing that it has its own internationally acceptable protocol of handling cases like his.”

Keeping Private King in the North indefinitely might also have seemed more trouble than it was worth to Mr. Kim, said Mr. Cheong, who described the North Korean leader as more “practical minded” than his grandfather and his father, who led the country before him.

During the Cold War, the North’s totalitarian government took pains to prevent American military deserters from coming in contact with the general public​ because it feared the spread of news from the outside world among its people (as it still does).​ The soldiers were kept in special zones, provided with housing and language and ideological training and kept under constant surveillance.

The fact that Private King is Black may ​also have p​layed a role in the decision to expel him, said Kim Dong-sik, a former North Korean spy who defected to the South and worked in a government-run research institute in Seoul before opening his own consultancy.

“To the North Korean propagandists, the United States is a country dominated by white people, and a Black person is not a representative American face,” Mr. Kim said. “They may have decided that his usefulness as a propaganda tool was limited.”

Mr. Kim also noted that in North Korea, where the government has long touted a supposed racial “purity,” anti-Black racism is even stronger than anti-white racism.

That might have essentially ruled out the idea of letting Private King settle in the country, said Ahn Chan-il, a North Korean defector ​who runs the World Institute for North Korea Studies​ in Seoul. ​The North arranged marriages for the Cold War defectors — none of whom were Black — but only to North Korean women who were thought to be infertile, or to foreign women whom the government had apparently abducted, according to the memoir of one American defector, Charles Robert Jenkins.

“If they let him stay, they will eventually have to let him have a family,” Mr. Ahn said of Private King. “Given the pure-blood racism of the Kim dynasty, it’s hard to imagine” that being allowed, he added.

North Korea said on Wednesday that it was deporting Private King on charges of “illegal intrusion,” but it did not explain why it was not honoring his purported wish to settle in the North.

“​The North Koreans pick and choose what they want,” Mr. Ahn said. “It was best for the​m to get rid of ​him​.”