The intermittent nature of renewable energy generation and the fluctuating demands pose persistent challenges in microgrid operations. In response, stakeholders and operators have turned to clustering the geographically adjacent microgrids as a solution. In this context, this paper introduces a novel two-layer energy management strategy for microgrid clusters, utilizing demand-side flexibility and the capabilities of shared battery energy storage (SBES) to minimize operational costs and emissions, while ensuring a spinning reserve within individual microgrids to prevent load-shedding. In the lower layer, the proposed approach devises optimal day-ahead operation policies, while the upper layer employs a cooperative strategy to further optimize the operational efficiency across the entire cluster. The energy management problem is accurately formulated as a mixed integer quadratic programming (MIQP) optimization, which incorporates linear terms in the problem's constraints. The formulation accounts for operational costs associated with SBES including expenses of charging/discharging and changes in operating states (CiOS). Real-world case studies with a cluster of three microgrids in Australia validate the effectiveness of this approach. Results show a reduction in operational costs for the base case scenario by 6.96 % compared to conventional microgrid management strategies. Sensitivity analyses further demonstrate the economic benefits of varying SBES capacity and flexibility pricing, with savings ranging from 6.5 % to 8.1 %. The proposed strategy also reduces CO2 emissions by up to 11.6 %, while improving system reliability. This strategy holds promise for integration into distributed energy systems with high renewable penetration and clustered local grids, offering significant advantages for utility operators and end-users through improved energy efficiency and reduced emissions.