An experiment to put a homeless shelter in a San Francisco public school gym has so far been a costly failure, with so few families using it that it’s costing taxpayers about $700 for each person who spends the night.

School district and city officials cited a critical need when they opened the shelter at Buena Vista Horace Mann K-8 Community School in November and expected it to house up to 20 of the school’s families each night.

Instead, only five families have used the facility at 23rd and Valencia streets in the Mission, with an average occupancy of less than two people per night, said Jeff Kositsky, director of the city’s Department of Homelessness and Supportive Housing.

The facility is completely empty several nights each month, Kositsky said, although shelter workers are on-site seven nights a week and through holidays, whether anyone shows up or not. City officials and school leaders have proposed increasing the usage by allowing families from other schools to use the shelter.

On a cold, rainy evening earlier this week, a family of five showed up at the shelter just after 7 p.m. and got settled near the cots set up under the basketball hoops. The gym was warm and smelled of the ribs, salad and potatoes being served for dinner. A shower area was available in the back.

The three young children scampered into an adjacent classroom, where each grabbed a thick foam pad that they dragged onto the cots before hopping on their makeshift beds.

Staff at the shelter said they were expecting two more families that evening — the shelter is available from 7 p.m. to 7 a.m. — but there was no sign of them by 7:30 p.m.

Opening a shelter at the school, which serves 600 students, was virtually unprecedented and raised parent concerns about safety, the reliance on already overwhelmed facilities and the stigma students could face for having to live in the school gym.

Supervisor Hillary Ronen and the school’s administrators, however, advocated for the shelter, saying there were dozens of families facing homelessness at Buena Vista Horace Mann who needed someplace to sleep. The principal at the time, Richard Zapien, said he had identified 60 families in unstable housing.

With the school district’s blessing, the city opened the emergency shelter in November as a pilot program with the understanding it would be available at least through June.

The city has been paying the nonprofit Dolores Street Community Services $40,000 per month to manage the shelter, and if it were to be successful, would spend up to $900,000 per year to serve up to 20 families at a time with all-night staffing, food and support services to help them find permanent housing.

Yet the “well-intentioned” pilot program is “failing to meet its goals,” said Mayor London Breed, who expressed frustration at the inefficient use of funds.

“The Buena Vista Horace Mann community and the school district deserve credit for stepping up to be part of the solution,” Breed said, “but as we work to expand shelter and services for our unsheltered residents in San Francisco, we have to invest our resources in programs that deliver results.”

City officials now say the only way to keep the shelter open past this school year is to expand the pilot program, allowing families from other city schools to use the shelter as well. That would conflict with previous assurances to Buena Vista Horace Mann parents concerned about safety that the shelter would serve only their families.

“It didn’t serve enough people,” said Kositsky, adding that it makes sense to open up the shelter to more families since the city has already paid the startup costs. “Let’s see if there’s deeper demand for it.”

At least 15 families comprising 38 people would need to be using the shelter each night to make it cost-effective, he said.

Current demand hasn’t been close.

Family need “has been substantially lower than expected,” said Ronen, who spearheaded the pilot program. “It’s only been a few months, but if it continues at this ratio of students, I wouldn’t support spending this amount of money on that small number of students.”

If the district denies the request to expand access, the shelter will shut down in June, Kositsky said, adding there are vacancies at other emergency family shelters across the city the families could use. The city doesn’t have authority over district property and would have to get permission from the school board to expand access.

Buena Vista Horace Mann’s administrators are fighting to keep it open, saying the program has helped far more families than just the five who’ve used the shelter. With the help of case workers, many of the 60 families in unstable housing are finding long-term housing options and they haven’t needed the shelter, said Principal Claudia Delarios-Moran.

“Those services have arrived here because of the shelter,” she said. “It’s a program, it’s not a shelter.”

The school’s social worker, Nick Chandler, said there are more than 23 families that are “imminently homeless.” The shelter is a Plan B for them, he said, and often the initial reason they inquire about services.

He said many families ultimately don’t need the emergency housing if they have case workers and other support to find other options, including housing vouchers or long-term shelter space.

Without the shelter, Chandler said he fears people will assume there is no need for housing assistance at the school.

City officials acknowledged that the experiment has demonstrated that there is arguably a greater need to help the families find city and nonprofit services to help them avoid becoming homeless in the first place.

“We were able to meet the needs of housing insecure families with minimal use of the overnight facility,” Kositsky said.

But the shelter has been key to that success, Delarios-Moran and Chandler said, and they want to open it up to other schools to make it more financially viable.

District Superintendent Vince Matthews has asked for feedback about that from the school’s staff, students and families before making a recommendation to the school board, which would have to approve a new contract with the city to expand access.

Delarios-Moran said she will hold a parents meeting Monday.

Yet some parents are questioning the idea, saying city and school officials told the community there was a need for the shelter at Buena Vista Horace Mann and they were wrong, wasting taxpayer dollars.

“This is not to me a success,” said parent Johanna Lopez Miyaki. “Why didn’t they ask those 60 families what they needed? Why didn’t they ask the 60 families if they wanted to sleep on the gym floor?”

City officials emphasized that the shelter was a pilot program and opening it up to other families would be on a trial basis as well.

“We can try if the school is open to that,” Kositsky said. And if that doesn’t work, “we have to be brave enough and courageous enough to say, ‘Good try,’ and move on.”

Jill Tucker and Trisha Thadani are San Francisco Chronicle staff writers. Email: jtucker@sfchronicle.com, tthadani@sfchronicle.com Twitter: @jilltucker @TrishaThadani