The president defended the measure’s approach, which envisions the federal government sending grants to states to administer their own health care systems, and allowing them vast discretion over how to use the money. It would allow them to seek federal waivers to let insurers charge higher premiums to people with pre-existing medical conditions or to omit certain benefits that they are now required to provide, such as maternity care or mental health care.

“Better control & management,” Mr. Trump wrote. “Great for Arizona.”

“McCain let his best friend L.G. down!” the president added, referring to Mr. McCain’s close relationship with Senator Lindsey Graham of South Carolina, one of the bill’s sponsors.

Mr. Trump’s latest weekend Twitter fusillade came the morning after Mr. McCain surprised the president and his top aides by abruptly announcing that he could not “in good conscience” support the health care proposal by Mr. Graham and Senator Bill Cassidy of Louisiana, saying it was a partisan plan whose costs and impacts on the health care of millions of Americans were unknown.

The move by Mr. McCain, whose “no” vote against an earlier iteration of a health care repeal bill killed that effort in July, dealt yet another setback to Mr. Trump’s effort to fulfill his promise to do away with Barack Obama’s signature health care law. Senator Rand Paul, Republican of Kentucky, had already come out in opposition to his party’s last-ditch health care effort, and Senate leaders can afford to lose only two of their members in a chamber that is divided 52 to 48.