Faced with mounting debt and looming costs from the new federal health-care law, many local governments are leaving the hospital business, shedding public facilities that can be the caregiver of last resort.

Officials in Lauderdale County, Ala., this spring opted to transfer their 91-year-old Eliza Coffee Memorial Hospital and other properties to a for-profit company after struggling to satisfy an angry bond insurer.

"We...