It was strange enough that Philadelphia Democrats endorsed a City Council candidate whose Facebook page featured a host of racist and otherwise offensive messages. But it was more remarkable that party leaders eventually urged him to get out of the race.

Over the past two years, the Democratic-controlled city Traffic Court was found to be so corrupt that it was disbanded, a half-dozen Democratic state representatives and a state senator were caught up in criminal cases, and a Philadelphia Democrat resigned from the state Supreme Court amid investigations of pornographic e-mails and questionable legal fees. Now the party that did nothing to address those scandals just might have wised up a little.

The ill-chosen candidate, Manny Morales, hasn't: He says he's staying in the race. But he hardly seems ready for a campaign, much less elective office.

After he was accused of posting objectionable remarks on his Facebook page, Morales' initially failed to respond. Then he posted a note on his Facebook page saying he isn't racist, homophobic, or anti-poor because he knows African American and gay people and has eaten sandwiches made with government cheese. Then he accused his opponent, Councilwoman Maria Quiñones Sánchez, of fabricating the Facebook posts, though he offered no proof.

Sánchez, a competent, independent public servant whom the party has repeatedly refused to endorse, then produced additional offensive posts attributed to Morales on other websites, including those of a news station, a restaurant, and a state representative. Were they hacked, too?

U.S. Rep. Bob Brady, the city's Democratic Party chairman, asked for proof of Morales' claims and, when he didn't get it, asked the candidate to drop out. He followed Mayor Nutter and his predecessor, John Street, who were the first to ask the party to withdraw its support for Morales after the posts surfaced. That showed needed leadership.

The ward leaders who picked Morales apparently did so without even a minimal vetting process. Among them was City Controller Alan Butkovitz, who should know how to do his research before reaching conclusions.

Political leaders are responsible for their functionaries and candidates. Brady's tradition of allowing local ward leaders to pick candidates puts party factions ahead of baseline standards. Making loyalty its sole qualification has debased the party while elevating and protecting corrupt officials.

Most importantly, it results in poor representation for Philadelphians. Let's hope this rare rejection of an obviously unfit candidate marks a turning point.