Legal trouble for President Trump is coming from all sides. There’s evidence Paul Manafort was still communicating with the White House this year. There’s evidence suggesting the Russian government was offering “synergy” with the Trump campaign. There’s further evidence Trump directed Michael Cohen to make the hush-money payments to pornographer Stormy Daniels.

It’s still very unclear whether Trump broke any laws. It’s perfectly clear, however, that Trump got himself in this perfectly avoidable mess through bad behavior.

For starters: Had Trump not cheated on his wife with a porn actress, he would not have found himself during his presidential campaign, arranging for hush money to be paid to said porn actress. Now we learn that this hush money might have been illegal.

The legal argument is questionable, to be sure: The six-figure payment to the porn actress was made explicitly to protect Trump’s reputation during the campaign, and thus to aid in his election. Therefore, the reasoning goes, it was a campaign expenditure. A campaign expenditure has to be disclosed and made from the campaign committee account. Therefore it could have been an illegal, undisclosed campaign expenditure.

There’s a logic to that argument, but it’s a bit perverse.

A haircut could help a candidate’s odds of winning. Is paying for a haircut from your own pocket a campaign finance violation? When candidates are criticized for unpaid personal debts, do they need to repay the debts from the campaign committee because the payment helps their election chances? What about when politicians buy trinkets at gift shops in Des Moines or Manchester? Clearly these purchases are aimed at getting elected.

Trump could argue that it’s absurd to count as a campaign finance expenditure everything that enhances a politician’s reputation, and that the hush money was no different than a haircut. But take a step back and consider the position of the president here: He’s making a legalistic defense of hush money his shady lawyer paid to a porn actress to cover up the extramarital affair he had with her just after his wife had given birth to his son.

Trump wouldn’t be in the position had he followed the fairly basic rule in life, implied in the Sixth Commandment, but also held by most cultures, that one not cheat on one’s wife.

The other legal problems likewise could have been avoided had Trump simply followed basic rules of prudence and good living. Paul Manafort was a shady foreign agent, yet Trump hired him, and kept communicating with him after his habits of deception and corrupt ties to murderous strongmen were known. Stay away from Manafort, and many of these problems wouldn’t have happened.

[Trump: Pardon for Paul Manafort is on the table]

Similarly, Russian President Vladimir Putin, by 2015, was known to be a murderous strongman with imperial designs. High ethical standards would have cautioned the Trump campaign from special back-channel outreach—whether or not it was “collusion”—with Putin.

This isn't to say Democrats wouldn't be calling for impeachment in any event. And surely, one can get in legal trouble for far smaller misdeeds, and even for no misdeeds at all. But unethical behavior makes legal trouble more likely and trickier to get out of.

Don’t cheat on your wife. Don’t cavort with murderous strongmen. Don’t cavort with dirty operatives. If Trump and his campaign had followed these basic rules, they wouldn’t face the legal headaches they face today.