The resources and energy invested in creating the building are lost forever. The
value of the building was never intrinsic to the arrangement of its bricks, but to the desires of its tenants.
If all of them died when the building was destroyed, most of the value of the building is indeed lost. The crater still inherits the unrealized potential value of an expansion or remodel of the old building, from those people who were not tenants of the original building, who possibly might have wanted to occupy building space in the place where it stood, yet were somehow unable to do so. Perhaps the old building was full, or didn't have enough contiguous floor space left, or the space available was too expensive, or installing network fiber was not economical.
Otherwise, if all the tenants survived and continue to have a desire to occupy building space, the value attributable to them is likely to pass mostly to other buildings in the area, as they seek to relocate. They can also impart potential value to the crater, if they wouldn't mind occupying a new building in the same spot where their old one blew up.
Once the potential value of rebuilding in the crater is estimated to exceed the market value of the construction inputs, someone will make the necessary investment and capture the difference by constructing a new building.
Value is only limited by the bounds of human desires. The economy only produces a finite quantity of resources and energy per unit of time, though. Whatever is spent on rebuilding in a crater cannot also be spent on new building in a fresh development site, or on building a luxury yacht, or on programming a machine to make a different kind of "ping" noise, or on making all new Taco Bell menu items from the same old ingredients.
The value per thing ratio is continuously recalculated, and market prices eventually follow. So when you blow up a building, and don't kill all the people who gave it its value (or at least diminish their desire to consume in relation to their willingness to produce), that excess unmet desire redistributes to everything else in the economy. You're making most things imperceptibly more expensive, and a few things noticeably more expensive, such as the cost of occupying the nearby vacant building space.
Flows of resources are easy to calculate, but change in value is nearly impossible to predict.