I’m in California and was referencing our lawz...
The simple answer is, a private contract may have many things in it that the govt. can not do.
I can make a contract to not allow the use of the work RED in my home, it would be dumb but it is still a contract that if agreed to is quite binding under civil law.
Only contracts that force and illegal action are absolutly unenforcable
If so, you were still conflating two different concepts.