SAN JUAN, Puerto Rico—After Hurricane Maria ravaged this island, leaving most hospitals here without reliable power, the U.S. Navy sent a massive floating hospital to help fill gaps in the fragile health-care system.

Hardly anyone has used it.

The USNS Comfort, a 70,000-metric-ton ship staffed with roughly 800 medical and support personnel...