There are a few issues here, IMHO.
One is that codes being pushed with no info often just benefit the poster rather than the readers, perhaps the occasional newbie will be 'taken advantage of' either by paying a higher rate than they otherwise would have or a higher rate than a different discount would have gotten them. Folks are always pushing their Avis AWD #s in the Avis forum promising great, unspecified benefits. The only real benefit is the free rentals it will generate for the person offering the code.
Forum regulars are pretty good at warning newbies of this, and I think more generally that's the role of both experienced members and moderators. I wouldn't forbid folks from sharing these codes. I'd just roll my eyes at them for doing so.
As far as folks posting codes if they aren't supposed to... that's generally their own problem and legal risk, rather than Randy's as the service provider unless (and only sometimes even unless) there's specific knowledge of illegal transactions -- as opposed to simply sharing of proprietary information.
Remember that sharing information does not just permit people to use codes for their own discount benefit, though some use it that way. The posting of codes perform an important market function -- it tells consumers something about a travel provider's supply curve and reserve price. That tells you how low they might go in your own negotiations (or how low they might set a Priceline rate, or..). That's valuable information that I think we ought to permit.
That leaves aside the fact that some individuals may be covered by non-disclosure agreements, but those don't generally apply to individual travelers at a company benefiting from a particular discount.
Marriott Discount Codes have a dedicated thread in the Marriott forum. There are always ethics discussions about whether to use others' negotiated rates that are publicly available via a code entered online. Different folks feel differently about the question, and I guess there could be an official policy statement about it but I tend to favor the sharing of information and letting folks sort these issues out in posts and discussions and for themselves.
Personally I have some great negotiated corporate rates that I can use at some really nice places, I share those with Flyertalkers when appropriate but don't post them. This discussion is prompting me to at least ask myself why that is.