illegality
noun
Definitions
The state of being illegal
Example: The criminal was aware of the illegality of his act.
A defense to the validity of a contract because it was in violation of the law
Example: When sued for refusing to pay for services provided by a prostitute, the customer raised the defense of illegality.