Interconnected ensembles of biological entities are perhaps some of the most complex systems that modern science has encountered so far. In particular, scientists have concentrated on understanding how the complexity of the interacting structure between different neurons, proteins, or species influences the functioning of their respective systems. It is well established that many biological networks are constructed in a highly hierarchical way with two main properties: short average paths that join two apparently distant nodes (neuronal, species, or protein patches) and a high proportion of nodes in modular aggregations. Although several hypotheses have been proposed so far, still little is known about the relation of the modules with the dynamical activity in such biological systems. Here we show that network modularity is a key ingredient for the formation of self-organizing patterns of functional activity, independently of the topological peculiarities of the structure of the modules. In particular, we propose a self-organizing mechanism which explains the formation of macroscopic spatial patterns, which are homogeneous within modules. This may explain how spontaneous order in biological networks follows their modular structural organization. We test our results on real-world networks to confirm the important role of modularity in creating macroscale patterns.