For energy efficient operation of the massive multiple-input multiple-output (MIMO) networks, various aspects of energy efficiency maximization have been addressed, where a careful selection of number of active antennas has shown significant gains. Moreover, switching-off physical resource blocks (PRBs) and carrier shutdown saves energy in low load scenarios. However, the joint optimization of spectral PRB allocation and spatial layering in a heterogeneous network has not been completely solved yet. Therefore, we study a power consumption model for multi-cell multi-user massive MIMO 5G network, capturing the joint effects of both dimensions. We characterize the optimal resource allocation under practical constraints, i.e., limited number of available antennas, PRBs, base stations (BSs), and frequency bands. We observe a single spatial layer achieving lowest energy consumption in very low load scenarios, whereas, spatial layering is required in high load scenarios. Finally, we derive novel algorithms for energy efficient user (UE) to BS assignment and propose an adaptive algorithm for PRB assignment and power control. All results are illustrated by numerical system-level simulations, describing a realistic metropolis scenario. The results show that a higher frequency band should be used to support UEs with large rate requirements via spatial multiplexing and assigning each UE maximum available PRBs.