President Obama plays golf with Malaysian Prime Minister Najib Razak on Dec. 24, 2014, in Hawaii. (Jacquelyn Martin/Associated Press)

THE OBAMA administration has made a heavy bet on the Malaysian government of Najib Razak, whose majority Muslim nation collaborates on several key U.S. national security initiatives: counterterrorism, counterproliferation and balancing against China’s regional ambitions. In December, President Obama invited Mr. Najib to a round of golf during his Hawaiian vacation, a rare show of friendship for a foreign leader.

Since then, however, Mr. Najib has been evolving into an increasingly unseemly pal. In February, the country’s opposition leader, Anwar Ibrahim, was imprisoned on blatantly trumped-up charges, just under a year after the coalition Mr. Anwar led won the popular vote in national elections. That was the tip of a broader campaign to suppress the opposition; key leaders were indicted under a sedition law that Mr. Najib once promised to repeal, and a leading cartoonist was prosecuted for tweets. Mr. Anwar’s daughter, parliament member Nurul Izzah Anwar, was recently told she was being investigated under an anti-terrorism law.

Then came the news that close to $700 million had been transferred to personal bank accounts of Mr. Najib before the 2013 election. The Wall Street Journal reported in July that Malaysian investigators believed the money came from companies linked to a troubled state investment fund headed by the prime minister. Mr. Najib responded with a brazen crackdown on those investigating the fund, firing a deputy prime minister and the attorney general and gutting a parliamentary investigative committee. Two newspapers that had been pursuing the scandal were shut down. When the opposition organized a massive protest demonstration last month, authorities banned the movement’s signature yellow color.

Mr. Najib once positioned himself as a reformer who would lead a quasi-authoritarian state to genuine democracy. Now he is trying to consolidate his position by appealing to the worst currents in Malaysian politics: ethnic chauvinism and Islamic fundamentalism. In answer to the opposition, the ruling party, which relies on support from the majority Malay population, staged its own rally in which senior officials crudely attacked the Chinese and Indian minorities. Mr. Najib is meanwhile toying with the idea of allowing Islamic sharia law to be imposed in one province, a key goal of Malaysia’s fundamentalists.

In a visit to Kuala Lumpur last month, Secretary of State John F. Kerry said he had “raised concerns” with Mr. Najib about freedom of expression and Mr. Anwar’s imprisonment. But mostly the Obama administration is sticking with the sullied prime minister. In July, the State Department delivered a questionable promotion to Malaysia in its human trafficking ratings; Mr. Obama is still scheduled to visit Malaysia for an Asian summit in November. The administration appears to be counting on Mr. Najib to deliver Malaysia’s support for the Trans-Pacific Partnership, an Asian free trade deal that Mr. Obama hopes to make part of his legacy.

Nevertheless Ms. Nurul, who visited Washington this week, had a good question for the administration officials she met: “For all that you are investing in Malaysia, are you getting your money’s worth?” Mr. Najib may cooperate with U.S. intelligence agencies and the trade representative, but his repression and pandering to racists and Muslim extremists risks destroying the foundations of the alliance. The next time Mr. Obama meets his golfing buddy, he ought to make that clear.