By The Kansas City Star Editorial Board

Maintaining public support for U.S. involvement in two wars is difficult for any administration.

George W. Bush faced it when he was president; now Barack Obama does. But it doesn’t benefit any president or the military to try to hamstring press coverage of the wars in an effort to gain favorable public backing.

It always works against the administration once the shenanigans are revealed. Stars and Stripes, an editorially independent newspaper that receives Defense Department funding, recently reported that the U.S. military had a contract with a private public relations firm based in Washington, D.C., to “profile” journalists.

The Rendon Group rated journalists’ previous work as “positive,” “negative” or “neutral.”

Stars and Stripes reported that the secret profiles were used by military officials to prevent “disfavored reporters” from being embedded with the troops in Afghanistan.

U.S. military officials deny the allegation, saying the reports provided background information on the journalists enabling commanders to know about the reporters assigned to their units and the topics that might interest those journalists.

However, authorities were wise to terminate the $1.5 million media analysis contract. It didn’t pass the smell test of the military trying to control the independent work of the press.

News organizations must be free to cover the war without predetermined and secret conditions. The military needs to be above even the appearance of a conflict of interest in the press-Pentagon relationship to ensure accurate, fair and balanced reporting on the war in Afghanistan and in Iraq.

The credibility of the press and the Pentagon depends on news organizations maintaining their unrestricted role as the nation’s fourth estate watching over government. The public needs unfettered reporting from the best journalists.

No shortcuts or half-stepping can be tolerated in the military winning the public’s trust in wartime. Manipulating the news media under any circumstances is the wrong approach.