Restoring and improving harmony between human activities and nature are essential to human well-being and survival. The role of wastewater infrastructure is evolving toward resource recovery to address this challenge. Yet, existing design approaches for wastewater systems focus merely on technological aspects of these systems. If system design could take advantage of natural ecological processes, it could ensure infrastructure development within ecological constraints and maximize other benefits. To test this hypothesis, we illustrate a data-driven, systems-level approach that couples natural ecosystems and the services they deliver to explore how sustainability principles could be embedded into the life phases of wastewater systems. We show that our design could produce outcomes vastly superior to those of conventional paradigms that focus on technologies alone, by enabling high-level recovery of both energy and materials and providing substantial benefits to offset a host of unintended environmental effects. This integrative study advances our understanding and suggests approaches for regaining a balance between satisfying human demands and maintaining ecosystems.