Is it OK to include advertising in Drupal modules and themes? If so, how and where? These guidelines are aimed at outlining best practices.
Note that policy here was promoted in this page over a period of years and in Review and finalize "Guidelines regarding advertising and Drupal projects". Policy changes, when required, can be initiated in the Governance Issue Queue.
Keeping modules and themes usable
As with any other UI consideration, advertising in modules and themes should be approached with the needs and interests of users in mind. A good question to ask is, "Will all or almost all users of this module or theme wish to have this feature?" If the answer is no, then the feature should probably be left out. At the very least, it should be an admin-configurable option that is off by default and can be easily disabled when present.
The drupal.org infrastructure is offered to enable the sharing of extensions that anyone can use and enhance. Many or most site developers will not wish to have advertising on their sites.
For pretty obvious reasons, site developers should be able to use a module or theme without having to resort to hacking the code to remove hard-coded features that no one wants.