BANGKOK, Aug. 7 -- The students at Debsirin Secondary School were known for one thing above all else: getting into university. The school in Nonthaburi Province, on the outskirts of Bangkok, had spent decades cultivating a reputation as one of Thailand's most competitive college-preparatory institutions, drawing families from across the broader metropolitan area who believed rigorous academics was the surest route to a safer life for their children. On Friday morning, a ninth-grade student walked onto that campus with a gun.

By the time police had secured the building, seven people were dead. Three teachers. Three students. And the shooter himself, a boy still in the early years of secondary school, who took his own life after the attack...