Last month, in the heat of summer, Annette Schreiner got to her local pool just in time to see a police officer posting a decree informing residents that the pool, closed since December, would not be reopening.

“When the town learned that the pool was closing, people didn’t understand,” Ms. Schreiner said. “Why would you close a pool when there’s a heat wave every summer?”

The reason, said officials where she lives in Montlhéry, just south of Paris, is that the pool had become too expensive to maintain. An increasing number of municipalities in France, where energy has become more expensive and water is ever scarcer, are coming to the same conclusion.

The problem is limited to a relative handful of municipalities in a vast system with more than 6,000 public pools and open-air basins in France, a network denser than those in neighboring countries like Germany and Britain.

But at least a dozen towns and cities across the country have shuttered public pools this summer, reflecting the intersection of several crises for France — rising energy costs, extreme temperatures and mounting pressure on public budgets — that are felt most acutely in low-income and working-class areas.

Last winter, pools were hit particularly hard by the energy crisis that gripped Europe, as the war in Ukraine forced the Continent to stop relying on cheap Russian gas. At that time, Vert Marine, a private company in charge of some French municipal pools, shut 30 of them for three weeks.

“It was a unilateral, brutal decision,” said Guillaume Perrin, who runs a program to help French counties save energy.

Since then, many pools have reduced their water temperature to save energy and cut their opening hours. Others, like the communes of Descartes and Le Blanc, both in central France, have not reopened their public pools this summer. Still others, like Montlhéry, closed their pools indefinitely. Montlhéry said the spike in energy prices increased the cost of running the pool by a third, as compared to the previous year.

Rising energy costs were frequently cited as the reason for the closures, but others included a national shortage of lifeguards, temporary renovations, or leaks and other problems deemed too costly to fix.

“This winter acted as a true wake-up call for towns,” Mr. Perrin said. They kept calling him, asking for quick fixes to make their pools more energy efficient. That was not always possible.

“There are two types of deficits for counties, the acceptable kind and the unacceptable kind,” Mr. Perrin says. “Energy prices this winter made some pools tip into the unacceptable kind.”

But as heat waves become more frequent in France, conflicts over spending priorities could become more common. Just opposite Montlhéry’s closed pool, there is a brand-new soccer stadium. “They found money for soccer, but not for swimming,” Ms. Schreiner said.

It is likely that not all local residents will be affected equally by the closure. “The poorer you are, the more time you spend in the public pool,” said Cornelia Hummel, a Swiss sociologist who has studied the ways municipal pools create a sense of community.

Poor suburbs on the edges of cities have the fewest number of public pools in France, according to the nation’s court of auditors, which is in charge of making sure public money is put to good use.

Near the closed Montlhéry pool, Lucas Thomas sat on the wall around the parking lot where the cars of swimmers used to line up. Mr. Thomas, a 27-year-old truck driver, watched his two daughters, 6 and 2, cycle through the empty lot.

“It was an impeccable pool,” he said. “My daughters used to go there during summer or with school.” The pool closed before his youngest daughter learned how to swim and he said he’s not sure how she’ll learn now, or when.

“The question of access to water is becoming increasingly political,” said Professor Hummel. “It doesn’t make sense to close a public pool, because people that can afford it turn to private pools that use more water per person.”

Warming temperatures are helping to deplete the groundwater in France. Earlier this year, several towns in the Var and Ardèche regions in the south refused to issue building permits because their water resources couldn’t accommodate any new demand, their mayors said. During a heat wave last July, the Indre region banned the filling of private pools to save water.

“When France invested in pools in the 1970s, it was to develop leisure, and so children could learn how to swim,” Mr. Perrin said. Some towns did not keep up their pools in the following decades. Marseille, France’s second-largest city, lost half of its municipal pools in the span of ten years, according to the court of auditors.

The same day in July that Montlhéry closed its pool, which is now emptied of its water, Marseille dropped the admission fees on its pools, to make the heat wave that was engulfing the city more bearable.

“I am making pools free from today until the heat wave ends,” the mayor, Benoît Payan, wrote on Twitter. “Take care of yourselves and of your loved ones,” he added, as temperatures reached 104 degrees Fahrenheit in the city.