The death toll was very high because 3 things came together:
Powerful earthquake, of magnitude 7.6
Location
Timing
The timing matters, for two reasons. First, there was no warning. Second, the earthquake was in the early hours of the morning, when most people were in their homes.
The location affected the death toll in two main ways.
First, the earthquake hit a large city. Tangshan itself was a city of approximately 1 million people, with another 6 million living in the area around the city.
Second, most buildings were made with unreinforced brick walls and pillars. This included multi-story buildings (2-8 stories), but these multi-story buildings were commercial/industrial, and largely empty at the time of the earthquake. More relevant to the lethality of the earthquake is that residential buildings (typically single-story) were also constructed of unreinforced brick. Unreinforced brick construction is very dangerous in earthquakes because:
It's weak, and will easily collapse. This might have been made worse by the poor quality of much of the brickwork, but even good unreinforced brickwork would have been likely to collapse. Approximately 90% of homes in Tangshan and the nearby severely affected area collapsed.
It's heavy, and can kill or injure occupants it collapses onto. Shiono (1995) calculated that approximately 30% of those in homes that collapsed were killed; other estimates are a little lower (e.g., 22%), due to lower death tolls used in the calculation (Shiono, 1995).
Damage was made worse in some cases due to soil liquefaction.
Given warning, and/or a different time of day, fewer people would have been indoors, and there might have been far fewer deaths. The 2008 Sichuan earthquake was more powerful, and affected more people, and resulted in a high death toll. However, while between 5 and 11 million were left homeless (which gives an idea of the number of collapsed houses), only about 70-90,000 died, compared with about 250,000 (to use a low estimate) in Tangshan which resulted in about 6-7 million homeless people. The 2008 earthquake was in the early afternoon, about 2.30pm Beijing time, compared with 3.42am for Tangshan.
EDIT: For a destructive earthquake with similar timing (early hours of the morning) and similarly earthquake-dangerous construction, see the 2003 earthquake in Bam, Iran. Magnitude 6.6 quake, hit at 5:26am. Much of the housing in Bam and nearby was unreinforced mud-brick. On average, these buildings were more fragile and more dangerous (mud-brick walls tend to be quite thick and heavy, and traditional roofs for these buildings are very heavy) than the housing in Tangshan. The high death toll, almost 30,000 of a population of approximately 90,000, resulted from essentially the same causes as in Tanghshan: earthquake without warning when people were sleeping indoors, in buildings that will easily collapse from a powerful earthquake, producing dangerously heavy rubble.
References:
Jennings, Paul C. (1980), "Chapter 4: Report on the Tangshan Earthquake", Earthquake Engineering and Hazards Reduction in China: A Trip Report of the American Earthquake Engineering and Hazards Reduction Delegation, National Academy of Sciences, pp. 69–133: https://www.nap.edu/catalog/19764/earthquake-engineering-and-hazards-reduction-in-china-a-trip-report
Shiono, Keishi. "Interpretation of published data of the 1976 Tangshan, China Earthquake for the determination of a fatality rate function." Structural Eng. /Earthquake Eng. Vol. 11, No. 4, 155s-163s, January 1995: https://www.jstage.jst.go.jp/article/jscej1984/1995/507/1995_507_25/_pdf/-char/ja