BEIJING—The death here of a 29-year-old man in police custody—a new father and graduate of a prestigious Chinese university—has exposed increasing anxieties in the country’s growing middle class, already shaken by a decelerating economy and a disparate series of high-profile incidents threatening their sense of stability.

Other wide-ranging targets of recent social-media attention include a violent string of attacks on doctors by embittered patients and their families, a demand that apartment owners in eastern China pay extra...