Designed to treat scores of servicemen injured in war, the U.S. Navy’s two hospital ships have been deployed to New York and California to help out with the coronavirus pandemic.

The USNS Mercy docked in Los Angeles on Friday and USNS Comfort will arrive in Manhattan on Monday to provide extra beds for non-Covid-19 cases, as pandemic patients swarm land-based hospitals on both U.S. coasts.

New...