The natural ecosystems provide services that are crucial for our survival as climate control, food and water security. A very persistent pattern is loss of biodiversity caused by human activities all over the world, mainly due to deforestation and agricultural expansion. One very important challenge for human societies is to find the equilibrium between economic growth and environmental sustainability. In this contribution we address the role developed by spatial heterogeneity due to resource distribution and fragmentation on the species diversity. We propose a spatial model in which species compete on a lattice that is divided in habitats containing different amount of resources. The landscape here is a fractal structure which changes gradually from highly fragmented to highly clumped. Fractal landscapes are constructed through the use of fractional Brownian motion and characterized by the Hurst exponent. We found from our simulation results that there is an optimum number of habitats in which the fragmentation level has no effect. As habitat number drift away from optimal value, fragmentation has a growing effect on biodiversity promotion, mostly for small values of the Hurst exponent H. We observed two power law regimes describing the species–area relationship, in which the exponent for small areas is always smaller than the one observed for large areas. We also observe for the majority of the cases we studied, that the value of species–area exponent in both regimes grows with the number of habitats and then drops when the number of habitats becomes large. The number of habitats revealed to be the most important variable to foster and control the biodiversity in all scenarios.