In New York, corruption does pay — or at least is no obstacle to holding on to public office.

Bad behavior was generally rewarded Tuesday as several sketchy lawmakers easily won new terms despite various ethical and legal clouds hanging over their heads.

Even worse, it wasn’t a contest (quite literally, in the case of one miscreant) — all enjoyed huge margins of victory.

* State Sen. Kevin Parker (D-Brooklyn) — a 97% winner: The “Ticking Time Bomb” last year received probation and a fine for a physical altercation with a Post photographer, one of several such Parker incidents in recent years.

* Assemblyman William Boyland (D-Brooklyn) — 95%. Boyland had the dubious distinction of being indicted by two separate US attorneys over the last year: He was caught soliciting bribes to help raise money for his legal bills on a separate corruption case.

* Assemblyman Vito Lopez — 90%. Despite multiple sexual-harassment claims against him, the most recent costing taxpayers a $103,000 settlement to two Albany staffers, the former head of the Brooklyn Democratic Committee sailed to another win.

* State Sen. Malcolm Smith (D-Queens) — uncontested: As The Post reported exhaustively, Smith co-founded and raised thousands of dollars for a Katrina-related charity that distributed hardly any money to the victims. The feds are investigating the entire affair.

* Assembly Speaker Sheldon Silver — 84%. In addition to his official duties, Silver has become Mr. Fix-It, crafting various coverups and payoffs for sexual scandals in his chamber (see the aforementioned Lopez settlement).

Finally, even when New Yorkers make the right decision — i.e., tossing a bad pol — the state’s corrupt culture tosses a lifeline.

The Post’s reporting on Bronx Assemblywoman Naomi Rivera getting taxpayer-funded jobs for boyfriends and family members led to a September primary loss.

No matter. In swoops the far-left union cat’s-paw Working Families Party to provide Rivera with its line. Thankfully, the public had had enough; Rivera only received 8% of the vote on Tuesday.

Alas, that she would even have a second chance speaks volumes of how difficult it is to cleanse New York’s corrupt political culture.