D.C. Mayor Muriel E. Bowser (D). (Matt McClain/The Washington Post)

ONCE AGAIN, D.C. officials found themselves ensnared in tumult over a lucrative government contract. And once again, questions were raised about whether campaign contributions played a role. When, we wonder, will the mayor and D.C. Council learn their lesson and put an end to the perception of the District as a place of pay-to-play by banning campaign contributions from those who get financial benefits from the government?

The latest controversy involved extension of a contract to the private consulting firm managing the city’s troubled United Medical Center in Southeast. Veritas of Washington last year was awarded an emergency no-bid contract by the hospital’s board, but the council in a 7-to-6 vote this week refused to approve a $4.2 million extension, citing instances of low-quality health care at the facility, which serves a poor and predominantly African American population.

Mayor Muriel E. Bowser’s administration had urged an extension, arguing that the firm had inherited long-term problems and was on the right track, and that ending the contract would cause harmful upheaval. Coloring the debate is the fact that Ms. Bowser (D), as The Post’s Peter Jamison has reported, had received more than $35,000 in political contributions from the husband of the owner of Veritas. Administration officials said Ms. Bowser was not involved in the firm’s selection and campaign contributions played no role.

We will, for the time being, take officials at their word. But shouldn’t they recognize how bad it looks and how that perception erodes public confidence in government? More than a dozen states, a growing number of local communities and the federal government explicitly ban campaign contributions from government contractors. The District needs to follow suit. Past efforts to address pay-to-play have been unsuccessful, but legislation is now pending before the council that would ban anyone, including a corporation, who donates to a campaign from engaging in major business — including large contracts — with the District for two years.

Ms. Bowser would do well to support this legislation and urge the council to enact it. Not only would it help to build confidence in government, but it would save her — and future mayors — a world of grief by shielding their decisions from any taint about whose interests are being served.