Her father was 83 years old, sweating and gasping for breath. Nancy Hopkins leaned down and rubbed his arm just before paramedics put him into an ambulance. “I’ll be with you every step of the way,” Ms. Hopkins promised him.

That was as close as she would ever again get to her dad. When she arrived at the nearby hospital in Conway, S.C., that evening in mid-March, she learned she could not go in because of visitor restrictions imposed during the coronavirus pandemic. She sat alone in her car in the hospital parking lot for...