MADRID — Spain prides itself on being a tight-knit society that respects parents and grandparents, where powerful bonds across generations mean that the elderly play an integral part in family life, beyond just helping to look after grandchildren.

So even in a country besieged by the coronavirus epidemic, where the death toll overtook China’s on Wednesday, the news about Spain’s nursing homes has come as a particular shock.

Soldiers who were sent to disinfect nursing homes had found people “completely abandoned, or even dead, in their beds,” the defense secretary, Margarita Robles, revealed on Monday. More gruesome discoveries followed, including the revelation of two dozen deaths in a single nursing home in Madrid.

Amid the thousands of tragedies created by the virus, the stories emerging from those homes have shaken the nation not only for their horror, but for undermining the view the Spanish had of themselves.