By code the Puppet Labs documentation means Puppet DSL and Ruby.
Puppet Module Fundamentals defines a module as:
Modules are self-contained bundles of code and data.
The code is a collection of text documents that control, extend or transform any of the behaviors of the programs that compose an installation of Puppet. Puppet code includes class definitions, defined type definitions and resource declarations. Ruby code includes definitions of functions, native types, providers, facts, rSpec tests and patches.
These text documents in /lib and /manifests are organized by a naming scheme set by the Puppet autoloader. The autoloader is a program that discovers the contents of these documents based on the file name and location.
Templates found in /templates in a module may be considered data. All template languages are programming languages. But templates are normally not the focus of the module's purpose. A module could exist that only distributes templates for other modules to use. But, fundamentally, templates are useless on their own without some resource or function to consume them.
Everything else in the module is some kind of data, mostly files in /files or meta-data.