> Nothing about that means that violating a contract, in and of itself, is illegal..
Its a violation of legal rights for which there are legal remedies. Claiming that its not a violation of law (the original upthread claim) is... well, as wrong as it is for any other violation of civil law. (“illegal" adds more complications because “illegal” has multiple overlapping senses, it can apply to any violation of law, or it can be used to refer specifically to criminal violations.)
> What you may do is suffer whatever penalties that the contract specifies will happen if the contract is violated
No, contract law itself specifies penalties for contract violations. Contracts may attempt to specify damages for certain violations as a replacement for the usual calculation of actual damages (“liquidated damages” provisions), but contract law governs when these will be given effect instead of the usual assessment of actual damages. It is neither necessary for there to be a specified penalty in the contract for one to be applied, nor will a specified penalty automatically be applied.