The great variety of earth's microorganisms and their functions are attributed to the heterogeneity of their habitats, but our understanding of the impact of this heterogeneity on microbes is limited at the microscale. In this study, we tested how a gradient of spatial habitat complexity in the form of fractal mazes influenced the growth, substrate degradation, and interactions of the bacterial strain Pseudomonas putida and the fungal strain Coprinopsis cinerea. These strains responded in opposite ways: complex habitats strongly reduced fungal growth but, in contrast, increased the abundance of bacteria. Fungal hyphae did not reach far into the mazes and forced bacteria to grow in deeper regions. Bacterial substrate degradation strongly increased with habitat complexity, even more than bacterial biomass, up to an optimal depth, while the most remote parts of the mazes showed both decreased biomass and substrate degradation. These results suggest an increase in enzymatic activity in confined spaces, where areas may experience enhanced microbial activity and resource use efficiency. Very remote spaces showing a slower turnover of substrates illustrate a mechanism which may contribute to the long-term storage of organic matter in soils. We demonstrate here that the sole effect of spatial microstructures affects microbial growth and substrate degradation, leading to differences in local microscale spatial availability. These differences might add up to considerable changes in nutrient cycling at the macroscale, such as contributing to soil organic carbon storage.