I think you're the one confusing the two. Violating a unenforceable contract clause isn't unlawful, but is pretty much breaking a promise, which is definitely unethical.
Is it ethical to include an unenforceable clause in a contract?
Yes. Why wouldn’t it be?
Consider a clause that is unenforceable because it contradicts some rights enshrined in law. If someone was misled into believing the clause is enforceable, their rights have been infringed on unfairly due to an imbalance of information
Probably about as ethical as it is to agree to one with the intent of breaking such a clause.