The legality of object is a fundamental principle in contract law that requires the purpose of a contract to be lawful for the contract to be enforceable. If the object of a contract is illegal or against public policy, the contract is void and unenforceable in a court of law.