Surgical resection is considered necessary when less invasive treatments fail or are not viable. It is commonly indicated in cases of pediatric tumors, both benign and malignant, congenital malformations like congenital diaphragmatic hernia, and severe infections that do not respond to antibiotics.