Spot-scanning proton arc therapy (SPAT) is an emerging modality to improve plan conformality and delivery efficiency. A greedy and heuristic method is proposed in the existing SPAT algorithm to select energy layers and sequence energy switching with gantry rotation, which does not promise optimality in either dosimetry or efficiency. We aim to develop a method to solve the energy layer switching and dosimetry optimization problems in an integrated framework for SPAT. In an integrated approach, energy layer optimization for spot-scanning proton arc therapy (ELO-SPAT) is formulated with a dose fidelity term, a group sparsity regularization, a log barrier regularization, and an energy sequencing (ES) penalty. The combination of L2,1/2-norm group sparsity regularization and log barrier function allows one energy layer being selected per control point. The ES regularization term sorts the delivery sequence from high energy to low energy to reduce the total energy layer switching time (ELST) and subsequently the total delivery time. Within the ES penalty, the gradient of layer weights between adjacent beams is first calculated along beam direction and then along energy direction. The gradients indicate energy switch patterns between two adjacent beams. The time-wise costly energy switch-up is more heavily penalized in the ES term. This ELO-SPAT method was tested on one frontal base-of-skull (BOS) patient, one chordoma (CHDM) patient with a simultaneous integrated boost, one bilateral head-and-neck (H&N) patient, and one lung (LNG) patient. We compared ELO-SPAT with intensity-modulated proton therapy (IMPT) using discrete beams and SPArc by Ding et al. For the two arc algorithms, both the plans with and without energy sequencing were created and compared. Energy layer optimization for spot-scanning proton arc therapy reduced the runtime of optimization by 84% on average compared with the greedy SPArc method. In both the ELO-SPAT plans with and without ES, one energy layer per control point was selected. Without ES regularization, the energy sequence was arbitrary, with around 40-60 switch-up for the tested cases. After adding ES regularization, the number of energy switch-up was reduced to less than 20. Compared with the energy sequenced SPArc plans, the ELO-SPAT plans with ES led to 24% less total ELST for synchrotron plans and 14% less for cyclotron plans. Both the ELO-SPAT and SPArc plans achieved better sparing compared with the IMPT plans for most Organs-at-risks (OARs), with or without ES. Without ES, the ELO-SPAT plans achieved further improvement of the OARs compared with the SPArc plans, with an averaged reduction of OAR [Dmean, Dmax] by [1.57, 3.34] GyRBE. Adding the ES regularization degraded the plan quality, but the ELO-SPAT plans still had comparable or slightly better sparing than the SPArc plans with ES, with an averaged reduction of OAR [Dmean, Dmax] by [1.42, 2.34] GyRBE. We developed a computationally efficient spot-scanning proton arc optimization method, which solved energy layer selection and sequencing in an integrated framework, generating plans with good dosimetry and high delivery efficiency.