Achieving high data rate transmission is critically constrained by green communication metrics in Wireless Sensor Networks (WSNs). A unified metric ensuring a successful compromise between the energy efficiency (EE) and the spectral efficiency (SE) is, then, an interesting design criterion in such systems. In this paper, we focus on EE-SE tradeoff optimization in Wireless Underground Sensor Networks (WUSNs) where signals penetrate through a challenging lossy soil medium and nodes’ power supply is critical. Underground sensor nodes gather and send sensory information to underground relay nodes which amplify-and-retransmit received signals to an aboveground sink node. We propose to optimize source and relay powers used for each packet transmission using an efficient recent metaheuristic optimization algorithm called Salp Swarm Algorithm (SSA). Thus, the optimal source and relay transmission powers, which maximize the EE-SE tradeoff under the maximum allowed transmission powers and the initial battery capacity constraints, are obtained. Further, we study the case where the underground medium properties are dynamic and change from a transmission to another. For this situation, we propose to allocate different maximum node powers according to the soil medium conditions. Simulation results prove that our proposed optimization achieves a significant EE-SE tradeoff and prolongs the network’s lifetime compared to the fixed allocation node power scheme. Additional gain is obtained in case of dynamic medium conditions.