Another example would be that you can not contract for sexual services. There was a case last year stemming from a craigslist.org ad from a man who wished to rent out a room in his house in compensation for sexual rather than monetary favors.
He was arrested and thrown in jail under pandering laws.
Understood and I was not attempting to advocate that you can contract for literally anything you wish. Although the particular example you selected would be fodder for a spirited debate with any real libertarian in the room..... point is I would not use that example and expect to remain on rock solid ground, but it wasn't my point any way. My point is that when you apply for a "license" you are voluntarily agreeing that the other party has both the authority and the power to dictate the rules under which that license is held and the procedures in play when certain circumstances are presented.
To voluntarily accept a contract and avail yourself of any associated benefits under that contract very quickly erode any legal right you may have to challenge that contract and unless there is some other factor to come into play, it's not even a Constitutional issue.