Unmanned aerial vehicle (UAV) communications can be leveraged for efficient data collection from widely distributed sensors in wireless sensor networks (WSNs). Integrating federated learning (FL) with UAV-enabled WSNs allows decentralized and privacy-preserving training of machine learning models, enabling different Internet-of-things applications. Achieving energy efficiency for such FL-based systems is important due to the limited battery capacities of both UAVs and sensors but it remains an open challenge to the best of our knowledge. To fill this research gap, we study the joint design of UAV trajectory, data transmission, and computational resource allocation and formulate it as an optimization problem aiming to minimize the total weighted energy consumed by sensors and UAVs. In order to solve the underlying difficult mixed-integer nonlinear optimization problem, we employ the alternating optimization approach, where we sequentially solve different sub-problems in each iteration until convergence. We show that the data transmission and computational resource allocation sub-problems can be transformed into linear integer and convex optimization problems, respectively. Meanwhile, the successive convex approximation method is employed to tackle the UAV trajectory control sub-problem. Via extensive simulations, we demonstrate the effectiveness of our approach, showcasing significant energy savings and improved performance compared to other benchmarks. We also analyze the impacts of key parameters and the trade-off between learning performance and energy consumption via numerical studies.